Re: [PATCH] Fix premature call to git_config() causing t1020-subdirectory to fail
- From
Daniel Barkalow <barkalow@iabervon.org>
- Date
- Feb 26, 2008, 22:12 UTC
- Message-ID
- <alpine.LNX.1.00.0802261709180.19665@iabervon.org>
- In-Reply-To
- <200802261640.48770.johan@herland.net>
On Tue, 26 Feb 2008, Johan Herland wrote:
Show 25 quoted lines
> We need to call git_config(git_default_config) in order to get user.name and > user.email (so that reflogs will be correct), but if we do it too early, it > interferes with the setup of reference repos. Therefore, move git_config() > call to _after_ the reference has been setup (but before we start writing > reflogs). However, in order for git_config() to read in the global > configuration at that point, we must unset CONFIG_ENVIRONMENT. > > There are probably better ways of resolving this issue. > > Signed-off-by: Johan Herland <johan@herland.net> > --- > > On Tuesday 26 February 2008, Johan Herland wrote: > > - Call git_config(git_default_config) in order to properly set up > > user.name and user.email for reflogs (This BREAKS test #9 in > > t1020-subdirectory.sh. Have yet to figure out why) > > Here is a fix for this breakage, although I think it's ugly as hell. > > But with this fix, and the other one I just sent out for the > for_each_ref() corruption, the whole test suite finally passes on my > box. > > Feel free to incorporate this into the further builtin-clone work, > or ignore it, and find better ways of solving these issues.
Actually, I think I'll be leaving CONFIG_ENVIRONMENT alone entirely; I was only using it to override the setting that t5505 uses, but t5505 is just wrong to set it. So this is the right placement of git_config(), and the setenv and unsetenv aren't needed.
-Daniel *This .sig left intentionally blank*