git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [PATCH v2 5/9] t1300: disable system-wide config for tests that wants to read from -c
Date: Thu, 29 Sep 2016 14:00:10 -0700	[thread overview]
Message-ID: <20160929210014.3874-6-gitster@pobox.com> (raw)
In-Reply-To: <20160929210014.3874-1-gitster@pobox.com>

This test wants to do

	git -c x.two=2 config --get-regexp ^x\.*

and see x.two that came from the one-shot configuration in its
output.  This form cannot be limited with "--local", as it limits
the input to the local configuration file and makes these one-shot
settings ignored.  At this point, the test knows that there is no
variable that match x.* in its local configuration, and it also was
OK to assume that there is nothing in the system-wide config or
global one.

Make sure that assumption holds by using the GIT_CONFIG_NOSYSTEM
environment, as we may add anything to t/gitconfig-for-test later.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t1300-repo-config.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index 940469339bd2..95734034e0d5 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -1093,6 +1093,7 @@ test_expect_success 'multiple git -c appends config' '
 	x.one 1
 	x.two 2
 	EOF
+	GIT_CONFIG_NOSYSTEM=1 \
 	git -c x.one=1 x >actual &&
 	test_cmp expect actual
 '
-- 
2.10.0-589-g5adf4e1


  parent reply	other threads:[~2016-09-29 21:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-29 21:00 [PATCH v2 0/9] allow customizing /etc/gitconfig location with an environment Junio C Hamano
2016-09-29 21:00 ` [PATCH v2 1/9] config: " Junio C Hamano
2016-09-29 21:00 ` [PATCH v2 2/9] t1300: always compare expect to actual Junio C Hamano
2016-09-29 21:00 ` [PATCH v2 3/9] t1308: ignore system-wide config in the iteration test Junio C Hamano
2016-09-29 21:00 ` [PATCH v2 4/9] t1300: check also system-wide configuration file in --show-origin tests Junio C Hamano
2016-09-29 21:00 ` Junio C Hamano [this message]
2016-09-29 21:00 ` [PATCH v2 6/9] t1300: take contents of system-wide configuration into account in "--list" test Junio C Hamano
2016-09-29 21:00 ` [PATCH v2 7/9] t1300: be explicit in local configuration tests Junio C Hamano
2016-09-29 21:00 ` [PATCH v2 8/9] worktree: honor configuration variables Junio C Hamano
2016-09-29 21:00 ` [PATCH v2 9/9] core.abbrev: raise the default abbreviation to 12 hexdigits Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20160929210014.3874-6-gitster@pobox.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).