t1500: avoid setting configuration options outside of tests
commit1dea0dc9e0965e2581cdf64fc9eb072e8d6a88d3
authorEric Sunshine <sunshine@sunshineco.com>
Wed, 18 May 2016 20:15:44 +0000 (18 16:15 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 18 May 2016 21:15:10 +0000 (18 14:15 -0700)
tree4704f2a6a48caa260a76e7c58bf96635c25ce4c4
parent1e043cff7815786b3d1a4c07bac63b3d8e1e30ef
t1500: avoid setting configuration options outside of tests

Ideally, each test should be responsible for setting up state it needs
rather than relying upon transient global state. Toward this end, teach
test_rev_parse() to accept a "-b <value>" option to allow callers to set
"core.bare" explicitly or undefine it. Take advantage of this new option
to avoid setting "core.bare" outside of tests.

Under the hood, "-b <value>" invokes "test_config -C <dir>" (or
"test_unconfig -C <dir>"), thus git-config knows explicitly where to
find its configuration file. Consequently, the global GIT_CONFIG
environment variable required by the manual git-config invocations
outside of tests is no longer needed, and is thus dropped.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1500-rev-parse.sh