Point at --abort when a paused rebase loses its stack

If the stack file changes while a rebase is paused on a conflict — a branch
removed, the stack unstacked — `gh stack rebase --continue` failed with a bare
"no stack found for branch X". The recovery state is still on disk at that
point and `--abort` still restores everything, but nothing said so.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f5959297-80fd-4732-aeae-aa9a4b6a7755
This commit is contained in:
Sameen Karim
2026-07-27 13:15:04 -04:00
parent f7b560076e
commit fcacfc9f6c
+6 -1
View File
@@ -389,7 +389,12 @@ func continueRebase(cfg *config.Config, gitDir string) (rerr error) {
return err
}
if s == nil {
return fmt.Errorf("no stack found for branch %s", state.OriginalBranch)
// The stack changed under the paused rebase. Recovery state is still on
// disk, so say how to get out of it rather than leaving a dead end.
cfg.Errorf("no stack found for branch %s — the stack may have been modified since the rebase started", state.OriginalBranch)
cfg.Printf(" Run `%s` to restore all branches to their pre-rebase state.",
cfg.ColorCyan("gh stack rebase --abort"))
return ErrSilent
}
// Refresh PR state before selecting the base and cascading the remaining