Excluding a file in a worktree does not work
bradphelan opened this issue · comments
Describe the bug
The folder is a worktree d:\checkouts\foo\worktrees\wt2
and the main repo is :\checkouts\foo
I move the cursor to a file I wish to exclude. I press i then I press e. An error appears
there is no d:\checkouts\moduleworks\worktrees\wt2\.git
folder but there is a d:\checkouts\moduleworks\.git\worktrees\wt2
where an exclude file for worktrees should live. I think the exclude command is just not worktree aware
It was fixed by #3432, if you need it before the next release please try building from source.
Did you really get it to work with exclude? I'm actually surprised because in the last 5 min I've just tried doing it by manually editing d:\checkouts\foo\worktrees\wt2\.git\worktrees\wt2\info\exclude
and it doesn't work. If I append the same line to the global d:\checkouts\foo\worktrees\wt2\.git\info\exclude
then it does work.
If I append the same line to the global d:\checkouts\foo\worktrees\wt2.git\info\exclude then it does work.
Judging by the code diff that's what exactly what we're doing, which I see now might not be entirely aligned with "worktree exclude".
There's this SO answer that mentions there isn't a info/exclude
in the ./git/worktrees
, and judging by your experiment, it could be that it's not supported by git
itself.