Re: [PATCH] path_treatment: also ignore $GIT_DIR if it's not .git
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Dec 2, 2013, 12:01 UTC
- Message-ID
- <CACsJy8Afhr1syRW8UetKKHss2r9e2pN2dCmc99Aj9418SxAUMg@mail.gmail.com>
- In-Reply-To
- <1385984412.3240.17.camel@localhost>
On Mon, Dec 2, 2013 at 6:40 PM, Dennis Kaarsemaker <dennis@kaarsemaker.net> wrote:
Show 24 quoted lines
>> ~/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