gh-stack
gh-stack copied to clipboard
[Bug]: After running `git fsck`, `gh stack` may result in `cannot migrate stack catalogs`
Describe the bug
When a git fsck is run, and old objects are deleted, gh stack may error
Affected command
gh stack sync, gh stack unstack
gh-stack version
0.2.1
GitHub CLI version
gh version 2.102.0 (2026-09-30)
Operating system
Darwin caerbannog 25.5.0 Darwin Kernel Version 25.5.0: Tue Jun 9 22:28:34 PDT 2026; root:xnu-12377.121.10~1/RELEASE_ARM64_T6041 arm64 arm Darwin
Shell
zsh
Steps to reproduce
- Have a Git repo that's been used for some time
- Have stacks created against branches
- Now the branches have been merged, run
git fsck
Expected behavior
gh stack commands don't fail
Actual behavior
gh stack commands fail
Terminal output
% gh stack unstack --local
✗ migrating stack state: cannot migrate stack catalogs: non-trunk branches belong to differing stack definitions; sources: ["/Users/jamietanna/workspaces/renovatebot/renovate/.git/worktrees/log-status/gh-stack" "/Users/jamietanna/workspaces/renovatebot/renovate/.git/worktrees/reviews/gh-stack"]; branches: ["docs/apk-wolfi-example" "feat/dockerfile-apk-fuzzy-constraints"]; reconcile or recreate the intended tracking state before retrying
Preflight checks
- [x] I searched the existing issues for duplicates.
- [x] I ran
gh extension upgrade stackand reproduced this issue on the latest stable release.