Open bart-jaskulski opened 2 years ago
Thanks for reporting @bart-jaskulski.
Configured myself some worktrees locally to see what is going on exactly. Looks like this implementation works. I did add some minor comments to make it less confusing for future reference.
@bart-jaskulski Got any time to look at the comments I added above? Is there anything else I can do to get this merged?
@veewee Actually, I've made a bad assumption previously submitting PR (#1003) for git worktree path - git does store absolute path in
.git
file, but that's absolute path to the current worktree, while hooks are fired from common worktree root directory.The hierarchy looks something like:
With current patch, we are actually getting absolute path to worktree and reading the path from
commondir
file, which usually points up in hierarchy, to the root of git directory.