git@vger.kernel.org mailing list mirror (one of many)
 help / Atom feed
* [PATCH] test-lib.sh: unset XDG_CACHE_HOME
@ 2018-02-16  2:46 Genki Sky
  2018-02-16 18:35 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Genki Sky @ 2018-02-16  2:46 UTC (permalink / raw)
  To: git; +Cc: sky, Jeff King, Junio C Hamano

git respects XDG_CACHE_HOME for the credential cache. So, we should
unset XDG_CACHE_HOME for the test environment, lest a user's custom one
cause failure in the test.

For example, t/t0301-credential-cache.sh expects a default directory
to be used if it hasn't explicitly set XDG_CACHE_HOME.

Signed-off-by: Genki Sky <sky@genki.is>
---

Notes:

  This is the XDG_CACHE_HOME version of 5adf84ebb ("test-lib.sh: unset
  XDG_CONFIG_HOME", 2012-07-24).

 t/test-lib.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 9af19055b..001ef6b64 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -116,6 +116,7 @@ unset VISUAL EMAIL LANGUAGE COLUMNS $("$PERL_PATH" -e '
 	my @vars = grep(/^GIT_/ && !/^GIT_($ok)/o, @env);
 	print join("\n", @vars);
 ')
+unset XDG_CACHE_HOME
 unset XDG_CONFIG_HOME
 unset GITPERLLIB
 GIT_AUTHOR_EMAIL=author@example.com
--
2.16.1.195.g373da842b


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] test-lib.sh: unset XDG_CACHE_HOME
  2018-02-16  2:46 [PATCH] test-lib.sh: unset XDG_CACHE_HOME Genki Sky
@ 2018-02-16 18:35 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2018-02-16 18:35 UTC (permalink / raw)
  To: Genki Sky; +Cc: git, Junio C Hamano

On Thu, Feb 15, 2018 at 09:46:04PM -0500, Genki Sky wrote:

> git respects XDG_CACHE_HOME for the credential cache. So, we should
> unset XDG_CACHE_HOME for the test environment, lest a user's custom one
> cause failure in the test.
> 
> For example, t/t0301-credential-cache.sh expects a default directory
> to be used if it hasn't explicitly set XDG_CACHE_HOME.

Yep, this makes perfect sense. I can't believe it took almost a year for
somebody to trigger this. I guess most people don't set XDG_CACHE_HOME.

Thanks.

-Peff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-16  2:46 [PATCH] test-lib.sh: unset XDG_CACHE_HOME Genki Sky
2018-02-16 18:35 ` Jeff King

git@vger.kernel.org mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox