# Bug: Paths are wrong when --work-tree is an ancestor path

1 messages from 2025-06-16 to 2025-06-16. Participants: Serdar Sanli.
Thread: https://gitlist.dev/t/63654

## Serdar Sanli, 2025-06-16 19:36

Subject: Bug: Paths are wrong when --work-tree is an ancestor path
Message-ID: <CAM90XXeOic7c4FdWpjnqn2upcBmRQGRUFzR5vSeBP+=1cPErQQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAM90XXeOic7c4FdWpjnqn2upcBmRQGRUFzR5vSeBP%2B%3D1cPErQQ%40mail.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?

```
