fix(scm): resolve default merge method before running gh pr merge - #382
Merged
Conversation
`gh pr merge` requires an explicit --merge/--rebase/--squash flag when it runs without a TTY, so the top bar Merge PR action always failed while the merge strategy setting was "default". Resolve "default" against the repository's allowed merge methods (squash → merge → rebase, falling back to squash when the settings cannot be read) and always pass a concrete strategy flag on the merge, auto-merge, and clean-status fallback paths. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
astyfx
requested review from
paul-seo73 and
png-1105
and removed request for
a team
August 19, 2026 23:48
|
| Commit | Scanned at | New | Resolved | Net |
|---|---|---|---|---|
6ede39c < |
2026-08-19 23:49 UTC | 0 | 0 | 0 |
Last scanned: 6ede39c · 2026-08-19 23:49 UTC
|
| Commit | Scanned at | New | Resolved | Net |
|---|---|---|---|---|
6ede39c < |
2026-08-19 23:49 UTC | 0 | 0 | 0 |
Last scanned: 6ede39c · 2026-08-19 23:49 UTC
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The top bar Merge PR action always failed with
--merge, --rebase, or --squash required when not running interactively, becausegh pr mergedemands an explicit strategy flag when it runs without a TTY and the merge strategy setting defaults todefault.Changes
Fixes
defaultmerge strategy into a concrete one (squash → merge → rebase) using the repository's allowed merge methods, falling back to squash when the settings cannot be read, sogh pr mergealways receives a strategy flagRefactors / Chores
ConcretePrMergeMethodintosrc/lib/pr-status.tsso renderer and host share one typeTest Evidence
bun run typecheck— passbun test tests/scm-runtime-pr.test.ts tests/topbar-open-pr.utils.test.ts tests/source-control-pr.test.ts tests/git-graph-tag-args.test.ts— 51 pass, 0 failbun run check:switch-exhaustiveness,bun run check:max-lines-ratchet— passdefaultresolves per repository settings (merge when squash is disallowed, rebase when both are disallowed)Notes
An existing test asserted that GitHub picks the default strategy on its own; that premise was wrong for non-interactive runs, so it was updated to the new behavior. The host service must be restarted for the fix to take effect in a running app.