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

4 messages from 2008-02-26 to 2008-02-27. Participants: Daniel Barkalow, Jeff King, Junio C Hamano.
Thread: https://gitlist.dev/t/12334

## Daniel Barkalow, 2008-02-26 22:15

Subject: [PATCH] Don't use GIT_CONFIG in t5505-remote
Message-ID: <alpine.LNX.1.00.0802261713520.19665@iabervon.org>
URL: https://gitlist.dev/e/alpine.LNX.1.00.0802261713520.19665%40iabervon.org

```
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(-)

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, 2008-02-26 22:19

Subject: Re: [PATCH] Don't use GIT_CONFIG in t5505-remote
Message-ID: <20080226221959.GB6098@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20080226221959.GB6098%40sigill.intra.peff.net
In-Reply-To: <alpine.LNX.1.00.0802261713520.19665@iabervon.org>

```
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.

-Peff

```

## Junio C Hamano, 2008-02-27 08:16

Subject: Re: [PATCH] Don't use GIT_CONFIG in t5505-remote
Message-ID: <7vk5kqx18u.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vk5kqx18u.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <20080226221959.GB6098@sigill.intra.peff.net>

```
Jeff King <peff@peff.net> writes:

> 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, 2008-02-27 08:21

Subject: Re: [PATCH] Don't use GIT_CONFIG in t5505-remote
Message-ID: <7vd4qix11i.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vd4qix11i.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <alpine.LNX.1.00.0802261713520.19665@iabervon.org>

```
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.

```
