Re: What's cooking in git.git (topics)
- From
Jeff King <peff@peff.net>
- Date
- Feb 7, 2008, 05:05 UTC
- Message-ID
- <20080207050548.GA32242@sigill.intra.peff.net>
- In-Reply-To
- <7vbq6tset4.fsf@gitster.siamese.dyndns.org>
On Wed, Feb 06, 2008 at 06:03:51PM -0800, Junio C Hamano wrote:
Show 8 quoted lines
> * lh/gitdir (Mon Feb 4 21:59:21 2008 +0100) 4 commits > - git-submodule: prepare for the .git-file > - Add tests for .git file > - Document the .git-file > - Add platform-independent .git "symlink" > > Seems to have funny interaction with Jeff King's test script > updates.
I think this is a bug in Lars' code. The problem is that even though we set GIT_DIR to the contents of the '.git' file, we may already have run setup_git_env, which creates and remembers paths like '.git/objects'.
It worked with the old tests because we set GIT_CONFIG, which meant that looking at the config didn't require actually finding the .git directory. But now that we don't set GIT_CONFIG, setup_git_env gets called much earlier (to find the right config file). And I think this is a vindication of my change, since it reflects real world usage much more -- I can't even get the hash-object test to pass if I do it by hand, even though the test script passed.
The solution is probably to intercept the lookup of the .git directory in setup_git_env, and read the .git file there (this should probably get pulled out as a git_dir() function or similar).
-Peff