Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

[BUG] Wrong worktree path when using multiple worktree

From: Nicolas Morey-Chaisemartin <hidden>
Date: 2016-06-15 23:07:10

Hi,

There seem to be an issue with the path computed for a worktree when multiple worktree were created (using git worktree)
In my Setup, I have 3 repos:
A/repo (main One)
A/repo-patches (worktree, using branch dev)
B/repo (worktree, using branch next)

I'm working in A/repo-patches an run:
$ git checkout next
fatal: 'next' is already checked out at 'A/repo-patches'

Which is partially true but not completely.
I looked a bit in the code and found that the issue comes from here (get_linked_worktree):
    if (!strbuf_strip_suffix(&worktree_path, "/.git")) {
        strbuf_reset(&worktree_path);
        strbuf_addstr(&worktree_path, absolute_path("."));
        strbuf_strip_suffix(&worktree_path, "/.");
    }
Because it wrongfully assumes that I am in the linked worktree.
I checked in the .git/worktree files and couldn't see anything that actually points to where the repo are setup.

Nicolas
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help