Skip to content

Commit fcacfc9

Browse files
skarimCopilot
andcommitted
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
1 parent f7b5600 commit fcacfc9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cmd/rebase.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,12 @@ func continueRebase(cfg *config.Config, gitDir string) (rerr error) {
389389
return err
390390
}
391391
if s == nil {
392-
return fmt.Errorf("no stack found for branch %s", state.OriginalBranch)
392+
// The stack changed under the paused rebase. Recovery state is still on
393+
// disk, so say how to get out of it rather than leaving a dead end.
394+
cfg.Errorf("no stack found for branch %s — the stack may have been modified since the rebase started", state.OriginalBranch)
395+
cfg.Printf(" Run `%s` to restore all branches to their pre-rebase state.",
396+
cfg.ColorCyan("gh stack rebase --abort"))
397+
return ErrSilent
393398
}
394399

395400
// Refresh PR state before selecting the base and cascading the remaining

0 commit comments

Comments
 (0)