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

[PATCH v2 6/9] t1300: take contents of system-wide configuration into account in "--list" test

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 29, 2016, 21:00 UTC
Message-ID
<20160929210014.3874-7-gitster@pobox.com>
In-Reply-To
<20160929210014.3874-1-gitster@pobox.com>

One of the "git config" test tries to see that the command run without a valid repository still shows non-repository specific configuration. As we are planning to later make the system-wide file non-empty, prepare for the change by expecting to see the contents from it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t1300-repo-config.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 95734034e0d5..2a15cd4d150d 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -344,10 +344,11 @@ test_expect_success 'working --list' '
 	git config --list > output &&
 	test_cmp expect output
 '
-cat > expect << EOF
-EOF
 
-test_expect_success '--list without repo produces empty output' '
+test_expect_success '--list without repo shows only system-wide and global' '
+	# The global one aka $HOME/.gitconfig is missing,
+	# so we do not have to worry about it.
+	git config --system --list >expect &&
 	git --git-dir=nonexistent config --list >output &&
 	test_cmp expect output
 '
-- 
2.10.0-589-g5adf4e1
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 10 in “allow customizing /etc/gitconfig location with an environment”
  1. 0/9 allow customizing /etc/gitconfig location with an environmentJunio C Hamano, Sep 29, 2016
  2. 1/9 config: allow customizing /etc/gitconfig location with an environmentJunio C Hamano, Sep 29, 2016
  3. 2/9 t1300: always compare expect to actualJunio C Hamano, Sep 29, 2016
  4. 3/9 t1308: ignore system-wide config in the iteration testJunio C Hamano, Sep 29, 2016
  5. 4/9 t1300: check also system-wide configuration file in --show-origin testsJunio C Hamano, Sep 29, 2016
  6. 5/9 t1300: disable system-wide config for tests that wants to read from -cJunio C Hamano, Sep 29, 2016
  7. 6/9 t1300: take contents of system-wide configuration into account in "--list" testJunio C Hamano, Sep 29, 2016
  8. 7/9 t1300: be explicit in local configuration testsJunio C Hamano, Sep 29, 2016
  9. 8/9 worktree: honor configuration variablesJunio C Hamano, Sep 29, 2016
  10. 9/9 core.abbrev: raise the default abbreviation to 12 hexdigitsJunio C Hamano, Sep 29, 2016

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.