git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Fix wrong failures in config test

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 10, 2011, 18:30 UTC
Message-ID
<7vhbdg6286.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4d2b3198.674034bb.bm000@wupperonline.de>
Ingo Brückl <ib@wupperonline.de> writes:
Show 7 quoted lines
> The tests after '--set in alternative GIT_CONFIG' failed because
> variable GIT_CONFIG was still set.
>
> Signed-off-by: Ingo Brückl <ib@wupperonline.de>
> ---
>
> Is it only me (bash 3.2.48(1)-release) experiencing these failures?
>
>  t/t1300-repo-config.sh |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)

t1300 first sources test-lib.sh that explicitly unsets GIT_CONFIG and the tests that might touch GIT_CONFIG all do so by a single-shot assignment to be exported, i.e.

	GIT_CONFIG=other-config git config anwohner.park ausweis
that shouldn't affect the later test, unless the shell is broken.
With this patch, can you check which one of the new tests barf on you?
 t/t1300-repo-config.sh |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index d0e5546..c91d166 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -7,6 +7,10 @@ test_description='Test git config in different settings'
 
 . ./test-lib.sh
 
+test_expect_success 'is GIT_CONFIG set (0)?' '
+	test "z${GIT_CONFIG+set}" = z
+'
+
 test -f .git/config && rm .git/config
 
 git config core.penguin "little blue"
@@ -399,8 +403,17 @@ cat > expect << EOF
 ein.bahn=strasse
 EOF
 
+
+test_expect_success 'is GIT_CONFIG set (1)?' '
+	test "z${GIT_CONFIG+set}" = z
+'
+
 GIT_CONFIG=other-config git config -l > output
 
+test_expect_success 'is GIT_CONFIG set (2)?' '
+	test "z${GIT_CONFIG+set}" = z
+'
+
 test_expect_success 'alternative GIT_CONFIG' 'cmp output expect'
 
 test_expect_success 'alternative GIT_CONFIG (--file)' \
@@ -419,6 +432,10 @@ test_expect_success 'refer config from subdirectory' '
 
 GIT_CONFIG=other-config git config anwohner.park ausweis
 
+test_expect_success 'is GIT_CONFIG set (3)?' '
+	test "z${GIT_CONFIG+set}" = z
+'
+
 cat > expect << EOF
 [ein]
 	bahn = strasse
@@ -426,6 +443,10 @@ cat > expect << EOF
 	park = ausweis
 EOF
 
+test_expect_success 'is GIT_CONFIG set (4)?' '
+	test "z${GIT_CONFIG+set}" = z
+'
+
 test_expect_success '--set in alternative GIT_CONFIG' 'cmp other-config expect'
 
 cat > .git/config << EOF
Previous: Jonathan NiederNext: Ingo Br ückl
Message 5 of 11 in “Fix wrong failures in config test”
  1. Fix wrong failures in config testIngo Br ückl, Jan 10, 2011
  2. Jonathan NiederJan 10, 2011
  3. Ingo Br ücklJan 10, 2011
  4. Jonathan NiederJan 10, 2011
  5. Junio C HamanoJan 10, 2011
  6. Ingo Br ücklJan 10, 2011
  7. Jonathan NiederJan 10, 2011
  8. Junio C HamanoJan 10, 2011
  9. Jonathan NiederJan 10, 2011
  10. Ingo Br ücklJan 10, 2011
  11. Jonathan NiederJan 10, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.