`git rev-parse --git-common-dir` doesn't work in a subdirectory of the main work tree
- From
Mike Hommey <mh@glandium.org>
- Date
- Feb 12, 2016, 03:47 UTC
- Message-ID
- <20160212034723.GA20739@glandium.org>
Hi,
In a worktree, git rev-parse --git-common-dir returns the non worktree-specific git directory. e.g. .git instead of .git/worktrees/name. The problem is that while it returns the right thing from a subdirectory of a worktree, it doesn't from a subdirectory of the "main" work tree. In the latter case it returns ".git" instead of the full path to it.
Mike