When a rebase conflict was detected during 'gh stack sync', the function
continued to push branches and reported 'Stack synced' with exit code 0.
Now it persists PR state and returns ErrConflict immediately, preventing
the confusing post-conflict push and success message.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
When Ctrl+C is pressed during a prompter interaction, the CLI now prints
a friendly 'Received interrupt, aborting operation' message instead of
ugly wrapped errors like 'failed to read prefix: could not prompt:
interrupt'.
Changes:
- Add isInterruptError(), printInterrupt(), and errInterrupt sentinel
to cmd/utils.go for centralized interrupt detection
- Update all 8 prompt sites (init, push, checkout, utils) to detect
survey's terminal.InterruptErr and exit cleanly
- Update callers of resolveStack, pickRemote, and ensureRerere to
propagate interrupt without double-printing errors
- Change ensureRerere signature to return error so callers can abort
on interrupt
- Add tests for interrupt detection helpers
Closes td-746bdc
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Introduce Ops interface and MockOps for git operations, and ClientOps
interface with MockClient for GitHub API operations. This enables
command-level tests to inject mocks without changing production code.
- git.Ops interface wraps all 34 public git functions
- Package-level functions now delegate through a swappable ops variable
- SetOps()/CurrentOps() allow tests to inject MockOps
- github.ClientOps interface covers all Client methods
- MockClient provides configurable function-field test doubles
- All defaults return zero values; no-op for error returns
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>