Re: [PATCH] rev-parse: fix --git-common-dir when executed from subpath of main tree
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Apr 8, 2016, 11:47 UTC
- Message-ID
- <CACsJy8CgNy8+s0j+UUVVDk1ru702mtkTrO6QsYNpisGY-eAYGw@mail.gmail.com>
- In-Reply-To
- <1459734143-95832-1-git-send-email-rappazzo@gmail.com>
On Mon, Apr 4, 2016 at 8:42 AM, Michael Rappazzo <rappazzo@gmail.com> wrote:
Show 5 quoted lines
> Executing `git-rev-parse --git-common-dir` from the root of the main > worktree results in '.git', which is the relative path to the git dir. > When executed from a subpath of the main tree it returned somthing like: > 'sub/path/.git'. Change this to return the proper relative path to the > git directory (similar to `--show-cdup`).
I faced a similar problem just a couple days ago, I expected "git rev-parse --git-path" to return a path relative to cwd too, but it returned relative to git dir. The same solution (or Eric's, which is cleaner in my opinion) applies. --shared-index-path also does puts(git_path(... and has the same problem. Do you want to fix them too?
-- Duy