fix: no workdir status in bare cross-linked repos#2938
Open
leno23 wants to merge 2 commits into
Open
Conversation
leno23
added a commit
to leno23/gitui
that referenced
this pull request
May 17, 2026
Keeps PR gitui-org#2938 scoped to bare cross-linked repo status only (gitui-org#2876 is covered separately). Co-authored-by: Cursor <cursoragent@cursor.com>
Cross-linked bare repositories (separate-git-dir) are not inside a work tree, so Git CLI refuses status. Return an empty workdir/both status list instead of treating gitdir files as unstaged changes (gitui-org#2867).
Keeps PR gitui-org#2938 scoped to bare cross-linked repo status only (gitui-org#2876 is covered separately).
733802f to
2d32230
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In mutually cross-linked bare repositories (
git init --bare+git init --separate-git-dir=...),git statusfails with this operation must be run in a work tree, but GitUI still listed gitdir files (HEAD,config,hooks/, …) as unstaged changes.get_statusnow returns an empty list forWorkingDirandBothwhen the opened repository is bare and not a linked worktree, matchingis_workdir_cleanand Git CLI behavior.Test plan
cargo test -p asyncgit test_crosslinked_bare_repo_no_workdir_statuscargo test -p asyncgit get_status_with_workdirFixes #2867
Made with Cursor