threads / bug / 63654

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

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

## tl;dr

One message between Jun 16, 2025 and Jun 16, 2025.

replies: 0people: 1as markdown or json

Serdar Sanli· Jun 16, 2025, 19:36 UTC · lore

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?

← back to recent threads