OSDN Git Service

t/perf: export variable used in other blocks
authorJonathan Tan <jonathantanmy@google.com>
Thu, 2 Mar 2017 19:50:41 +0000 (11:50 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 3 Mar 2017 18:54:42 +0000 (10:54 -0800)
In p0001, a variable was created in a test_expect_success block to be
used in later test_perf blocks, but was not exported. This caused the
variable to not appear in those blocks (this can be verified by writing
'test -n "$commit"' in those blocks), resulting in a slightly different
invocation than what was intended. Export that variable.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/perf/p0001-rev-list.sh

index 16359d5..ebf1724 100755 (executable)
@@ -15,7 +15,8 @@ test_perf 'rev-list --all --objects' '
 '
 
 test_expect_success 'create new unreferenced commit' '
-       commit=$(git commit-tree HEAD^{tree} -p HEAD)
+       commit=$(git commit-tree HEAD^{tree} -p HEAD) &&
+       test_export commit
 '
 
 test_perf 'rev-list $commit --not --all' '