threads / patch / 12334

patchDon't use GIT_CONFIG in t5505-remote

Subject: [PATCH] Don't use GIT_CONFIG in t5505-remote

## tl;dr

4 messages between Feb 26, 2008 and Feb 27, 2008. Diffs are folded; open one to read it.

replies: 3people: 3as markdown or json

Daniel Barkalow· Feb 26, 2008, 22:15 UTC · lore

For some reason, t5505-remote was setting GIT_CONFIG to .git/config and exporting it. The sole effect of this was to cause the tests to fail if "git clone" obeyed it (which it presumably should).

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
---
Maybe test-lib used to set GIT_CONFIG to something that would interfere? 
Or the default behavior was wrong?
 t/t5505-remote.sh |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
Show changes to t/t5505-remote.sh +0 −3
diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh
index 636aec2..4fc62f5 100755
--- a/t/t5505-remote.sh
+++ b/t/t5505-remote.sh
@@ -4,9 +4,6 @@ test_description='git remote porcelain-ish'
 
 . ./test-lib.sh
 
-GIT_CONFIG=.git/config
-export GIT_CONFIG
-
 setup_repository () {
 	mkdir "$1" && (
 	cd "$1" &&
-- 
1.5.4.3.328.gcaed
Jeff King· Feb 26, 2008, 22:19 UTC · re: Daniel Barkalow · lore

Re: [PATCH] Don't use GIT_CONFIG in t5505-remote

On Tue, Feb 26, 2008 at 05:15:31PM -0500, Daniel Barkalow wrote:
Show 8 quoted lines
> For some reason, t5505-remote was setting GIT_CONFIG to .git/config
> and exporting it. The sole effect of this was to cause the tests to
> fail if "git clone" obeyed it (which it presumably should).
> 
> Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
> ---
> Maybe test-lib used to set GIT_CONFIG to something that would interfere? 
> Or the default behavior was wrong?

test-lib used to set it to ".git/config" until recently, so this would have been a no-op. As to why it was ever in here, I have no idea.

-Peff
Junio C Hamano· Feb 27, 2008, 08:16 UTC · re: Jeff King · lore

Re: [PATCH] Don't use GIT_CONFIG in t5505-remote

Jeff King <peff@peff.net> writes:
Show 13 quoted lines
> On Tue, Feb 26, 2008 at 05:15:31PM -0500, Daniel Barkalow wrote:
>
>> For some reason, t5505-remote was setting GIT_CONFIG to .git/config
>> and exporting it. The sole effect of this was to cause the tests to
>> fail if "git clone" obeyed it (which it presumably should).
>> 
>> Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
>> ---
>> Maybe test-lib used to set GIT_CONFIG to something that would interfere? 
>> Or the default behavior was wrong?
>
> test-lib used to set it to ".git/config" until recently, so this would
> have been a no-op. As to why it was ever in here, I have no idea.
Right.
Junio C Hamano· Feb 27, 2008, 08:21 UTC · re: Daniel Barkalow · lore

Re: [PATCH] Don't use GIT_CONFIG in t5505-remote

Daniel Barkalow <barkalow@iabervon.org> writes:
> For some reason, t5505-remote was setting GIT_CONFIG to .git/config
> and exporting it. The sole effect of this was to cause the tests to
> fail if "git clone" obeyed it (which it presumably should).

Your patch is correct, as it was a no-op to set and export GIT_CONFIG to .git/config there as Jeff pointed out.

But I think git-clone should explicitly ignore user-supplied GIT_CONFIG in the environment if exists, when it wants to update the configuration file for the new repository it created, as I mentioned in the other message.

And I think scripted version has the same issue. It would update random places GIT_CONFIG points at, when it wants to modify the configuration file for the new repository it just built, which would be a bug.

← back to recent threads