aboutsummaryrefslogtreecommitdiff
path: root/t/helper/test-dump-split-index.c
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2016-05-18 16:15:45 -0400
committerJunio C Hamano <gitster@pobox.com>2016-05-18 14:15:36 -0700
commite6273f4da51287363137a24200dd43b87c801b3d (patch)
tree7dec9f8ba2353a90793733856c7257a40f35de4e /t/helper/test-dump-split-index.c
parent1dea0dc9e0965e2581cdf64fc9eb072e8d6a88d3 (diff)
downloadgit-e6273f4da51287363137a24200dd43b87c801b3d.tar.gz
git-e6273f4da51287363137a24200dd43b87c801b3d.tar.xz
t1500: avoid setting environment variables 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 "-g <dir>" option to allow callers to specify the value of the GIT_DIR environment variable explicitly. Take advantage of this new option to avoid polluting the global scope with GIT_DIR assignments. Implementation note: Typically, tests avoid polluting the global state by wrapping transient environment variable assignments within a subshell, however, this technique doesn't work here since test_config() and test_unconfig() need to know GIT_DIR, as well, but neither function can be used within a subshell. Consequently, GIT_DIR is instead cleared manually via test_when_finished(). Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-dump-split-index.c')
0 files changed, 0 insertions, 0 deletions