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)