git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
SSSerdar 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?
Message 1 of 1 in “Bug: Paths are wrong when --work-tree is an ancestor path”
  1. Serdar SanliJun 16, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.