Bug: Paths are wrong when --work-tree is an ancestor path
- From
- Serdar Sanli <mserdarsanli@gmail.com>
- Date
- Jun 16, 2025, 19:36 UTC
- Message-ID
- <CAM90XXeOic7c4FdWpjnqn2upcBmRQGRUFzR5vSeBP+=1cPErQQ@mail.gmail.com>
I have /tmp/dir1/foo.txt and /tmp/dir2/foo.txt and a repo at /tmp/dir2/path/to/repo
From the repo if I do `git --work-tree /tmp/dir1 status` I see `foo.txt` listed as an untracked file, as expected. But if I do `git --work-tree /tmp/dir2 status`, I see `../../../foo.txt` shown instead, rather than `foo.txt`.
Can't see anything relevant in worktree documentation, this looks like a bug?