All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Witten <mfwitten@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Huynh Khoi Nguyen Nguyen 
	<Huynh-Khoi-Nguyen.Nguyen@ensimag.imag.fr>,
	git@vger.kernel.org
Subject: [PATCH 1/3] Testing: XDG config files: Export a suitable `XDG_CONFIG_HOME' environment variable
Date: Tue, 17 Jul 2012 16:41:20 -0000	[thread overview]
Message-ID: <679ad82bd4604d1c903f3c2fff2a8cfb-mfwitten@gmail.com> (raw)
In-Reply-To: <82316e5034d940e09fed719ae7bfdc3b-mfwitten@gmail.com>

The tests in:

  t/t1306-xdg-files.sh

were failing because the git commands were using the environment
variable `XDG_CONFIG_HOME' as it was set for the user's usual
environment, rather than as set for the testing environment.

This commit provides the quickest, simplest hack to make things work;
because there is already the setting and exporting of the environment
variable `HOME' in:

  t/test-lib.sh

this commit simply adds to that file the setting and exporting of
the variable `XDG_CONFIG_HOME' (based on the variable `HOME' that is
provided there).

However, the existing tests [sometimes] don't use these variables
explicitly, so the whole structure of this testing rests on the
hope that people maintain the conventions captured by the values
of these variables; another commit should fix this instability
by using these variables explicitly.

(Note: Double quotes are not needed around the value assigned
to the variable, as word splitting is not performed).

Signed-off-by: Michael Witten <mfwitten@gmail.com>
---
 t/test-lib.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index acda33d..69bcc75 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -544,6 +544,9 @@ rm -fr "$test" || {
 HOME="$TRASH_DIRECTORY"
 export HOME
 
+XDG_CONFIG_HOME=$HOME/.config
+export XDG_CONFIG_HOME
+
 if test -z "$TEST_NO_CREATE_REPO"; then
 	test_create_repo "$test"
 else
-- 
1.7.11.1.29.gf71be5c

  reply	other threads:[~2012-07-17 17:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-17 17:25 [PATCH 0/3] Testing: XDG config files: Fix broken tests Michael Witten
2012-07-17 16:41 ` Michael Witten [this message]
2012-07-17 17:57   ` [PATCH 1/3] Testing: XDG config files: Export a suitable `XDG_CONFIG_HOME' environment variable Jonathan Nieder
2012-07-17 18:14   ` Matthieu Moy
2012-07-17 18:31     ` Junio C Hamano
2012-07-17 16:41 ` [PATCH 2/3] Testing: XDG config files: Use "$HOME" and "$XDG_CONFIG_HOME" explicitly Michael Witten
2012-07-17 18:19   ` Matthieu Moy
2012-07-17 16:41 ` [PATCH 3/3] Testing: XDG config files: Trivial: `xdg' -> `XDG' Michael Witten

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=679ad82bd4604d1c903f3c2fff2a8cfb-mfwitten@gmail.com \
    --to=mfwitten@gmail.com \
    --cc=Huynh-Khoi-Nguyen.Nguyen@ensimag.imag.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.