Skip to content

fix: no workdir status in bare cross-linked repos#2938

Open
leno23 wants to merge 2 commits into
gitui-org:masterfrom
leno23:fix/bare-crosslink-status-2867
Open

fix: no workdir status in bare cross-linked repos#2938
leno23 wants to merge 2 commits into
gitui-org:masterfrom
leno23:fix/bare-crosslink-status-2867

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

In mutually cross-linked bare repositories (git init --bare + git init --separate-git-dir=...), git status fails with this operation must be run in a work tree, but GitUI still listed gitdir files (HEAD, config, hooks/, …) as unstaged changes.

get_status now returns an empty list for WorkingDir and Both when the opened repository is bare and not a linked worktree, matching is_workdir_clean and Git CLI behavior.

Test plan

Fixes #2867

Made with Cursor

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>
leno23 added 2 commits May 17, 2026 22:27
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).
@leno23 leno23 force-pushed the fix/bare-crosslink-status-2867 branch from 733802f to 2d32230 Compare May 17, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitUI shows working-tree changes in cross-linked bare repos where Git reports no work tree

1 participant