summaryrefslogtreecommitdiff
path: root/t/t1403-show-ref.sh
diff options
context:
space:
mode:
authorLibravatar Eric Sunshine <sunshine@sunshineco.com>2016-05-18 16:15:45 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-05-18 14:15:36 -0700
commite6273f4da51287363137a24200dd43b87c801b3d (patch)
tree7dec9f8ba2353a90793733856c7257a40f35de4e /t/t1403-show-ref.sh
parentt1500: avoid setting configuration options outside of tests (diff)
downloadtgif-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/t1403-show-ref.sh')
0 files changed, 0 insertions, 0 deletions