From: Lars Hjemli Date: Thu, 07 Feb 2008 09:43:12 GMT Subject: Re: What's cooking in git.git (topics) Message-ID: <8c5c35580802070143g697d82b7s3b04019664892f74@mail.gmail.com> In-Reply-To: <20080207050548.GA32242@sigill.intra.peff.net> On Feb 7, 2008 6:05 AM, Jeff King wrote: > On Wed, Feb 06, 2008 at 06:03:51PM -0800, Junio C Hamano wrote: > > > * 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'. Yeah, we need to run set_git_dir() to get all the paths set correctly: diff --git a/setup.c b/setup.c index 2cbda91..64b069f 100644 --- a/setup.c +++ b/setup.c @@ -339,7 +339,8 @@ const char *setup_git_directory_gently(int *nongit_ok) for (;;) { gitfile_dir = read_gitfile_gently(DEFAULT_GIT_DIR_ENVIRONMENT); if (gitfile_dir) { - setenv(GIT_DIR_ENVIRONMENT, gitfile_dir, 1); + if (set_git_dir(gitfile_dir)) + return NULL; break; } if (is_git_directory(DEFAULT_GIT_DIR_ENVIRONMENT)) But this isn't enough either, git-sh-setup.sh needs a patch when setting GIT_DIR and I just noticed merge-recursive failing (it needs to call setup_git_directory() in it's main()). I'll work on this tonight. -- larsh