On Mon, Dec 2, 2013 at 6:40 PM, Dennis Kaarsemaker
<den...@kaarsemaker.net> wrote:
>> ~/w/git $ cd t
>> ~/w/git/t $ GIT_TRACE_SETUP=1 ../git --git-dir=../.git --work-tree=..
>> --no-pager status
>> setup: git_dir: /home/pclouds/w/git/.git
>> setup: worktree: /home/pclouds/w/git
>> setup: cwd: /home/pclouds/w/git
>> setup: prefix: t/
>> On branch exclude-pathspec
>> Your branch and 'origin/master' have diverged,
>> and have 2 and 5 different commits each, respectively.
>>
>> I can't say this is the only case though. One has to audit to all
>> possible setup cases in setup_git_directory() to make that claim.
>
> I'm probably missing something, but that's the same as my second
> example, and works. I also tried running it from completely outside the
> repo:
>
> dennis@lightning:~$ code/git/git --git-dir=code/git/.foo --work-tree=code/git 
> status
> On branch master
> nothing to commit, working directory clean
> dennis@lightning:~$ code/git/git --git-dir=/home/dennis/code/git/.foo 
> --work-tree=code/git status
> On branch master
> nothing to commit, working directory clean

It looks like we try to convert git_dir relative to work_tree (in
setup_work_tree) so get_git_dir() probably always returns a path
relative to worktree if it's set. I don't know, it looks like so.
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to