From fe24f79d77164cb3c8870d31c4072bbba82bf991 Mon Sep 17 00:00:00 2001 From: Daniel Evers Date: Fri, 20 Feb 2026 10:49:43 +0100 Subject: [PATCH] fix(finish): Use the start point when finishing When finishing a branch, check the (stored) start point used to create the branch. If it differs from the configured start point, merge back to this branch instead. This ensures that e.g. creating releases from another branch works as expected. Resolves #71 Refs #36 --- cmd/finish.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/finish.go b/cmd/finish.go index 7435c68..d57b4b6 100644 --- a/cmd/finish.go +++ b/cmd/finish.go @@ -191,6 +191,14 @@ func executeFinish(branchType string, name string, continueOp bool, abortOp bool shortName = parts[len(parts)-1] } + // If a different parent branch was used to create the branch, use this instead of the configured one + if startPoint, err := git.GetBaseBranch(name); err == nil { + if startPoint != branchConfig.StartPoint { + fmt.Printf("Using base branch '%s'\n", startPoint) + branchConfig.Parent = startPoint + } + } + // Resolve all options once before starting operations resolvedOptions := config.ResolveFinishOptions(cfg, branchType, shortName, tagOptions, retentionOptions, mergeOptions, fetch, noVerify)