Skip to content

[Bug]: After running git fsck, gh stack may result in cannot migrate stack catalogs #595

Open

Description

@jamietanna

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

  1. Have a Git repo that's been used for some time
  2. Have stacks created against branches
  3. 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

  • I searched the existing issues for duplicates.
  • I ran gh extension upgrade stack and reproduced this issue on the latest stable release.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug Reports

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions