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

[PATCH 1/3] test-lib.sh: unset XDG_CONFIG_HOME

From
Jeff King <peff@peff.net>
Date
Jul 24, 2012, 11:53 UTC
Message-ID
<20120724115305.GA7328@sigill.intra.peff.net>

Now that git respects XDG_CONFIG_HOME for some lookups, we must be sure to cleanse the test environment. Otherwise, the user's XDG_CONFIG_HOME could influence the test results.

Signed-off-by: Jeff King <peff@peff.net>
---
[oops, re-sending because I forgot to cc git@vger]
You can test this trivially with:
  XDG_CONFIG_HOME=/whatever ./t1306-xdg-files.sh
 t/test-lib.sh | 1 +
 1 file changed, 1 insertion(+)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index acda33d..5e7f435 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -61,6 +61,7 @@ unset VISUAL EMAIL LANGUAGE COLUMNS $(perl -e '
 	my @vars = grep(/^GIT_/ && !/^GIT_($ok)/o, @env);
 	print join("\n", @vars);
 ')
+unset XDG_CONFIG_HOME
 GIT_AUTHOR_EMAIL=author@example.com
 GIT_AUTHOR_NAME='A U Thor'
 GIT_COMMITTER_EMAIL=committer@example.com
-- 
1.7.11.3.4.g9f70dbb
Next: Jeff King
Message 1 of 7 in “test-lib.sh: unset XDG_CONFIG_HOME”
  1. 1/3 test-lib.sh: unset XDG_CONFIG_HOMEJeff King, Jul 24, 2012
  2. 2/3 attr: make sure we have an xdg path before using itJeff King, Jul 24, 2012
  3. ignore: make sure we have an xdg path before using itMatthieu Moy, Jul 24, 2012
  4. Jeff KingJul 24, 2012
  5. 3/3 t1306: check that XDG_CONFIG_HOME worksJeff King, Jul 24, 2012
  6. Matthieu MoyJul 24, 2012
  7. Jeff KingJul 24, 2012

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.