gitui-org / gitui-org/gitui

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

Aperta
#2,867 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Rust
Stelle
22.5k
Fork
773
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

**Describe the bug**
In a mutual bare-repo reference setup, `gitui` shows working-tree file changes while Git CLI reports there is no work tree.

Example mismatch:
- `git status` in `/i4/repo0` returns: `fatal: this operation must be run in a work tree`
- `gitui` in `/i4/repo0` still shows many unstaged entries (`HEAD`, `config`, `hooks/`, etc.)

This is misleading because the repo is not in a valid work-tree state for normal file status operations.

**To Reproduce**
Steps to reproduce the behavior:
1. Create two repos at fixed reproducible paths:
```bash
mkdir -p /i4/repo0 /i4/repo1
```
2. Initialize and cross-link git directories:
```bash
cd /i4/repo0
git init --bare
git init --separate-git-dir=../repo1

cd /i4/repo1
git init --bare
git init --separate-git-dir=../repo0
```
3. Verify CLI behavior in `/i4/repo0`:
```bash
cd /i4/repo0
git status
```
Expected CLI output:
```text
fatal: this operation must be run in a work tree
```
4. Run `gitui` in the same path:
```bash
cd /i4/repo0
gitui
```
5. Observe that `gitui` still lists unstaged/untracked files.When Git reports no work tree, `gitui` should not show normal working-tree file changes. It should present an error/state consistent with Git CLI.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.