Skip to content

Commit 28e1fb5

Browse files
peffgitster
authored andcommitted
t/perf: add fallback for pre-bin-wrappers versions of git
It's tempting to say: ./run v1.0.0 HEAD to see how we've sped up Git over the years. Unfortunately, this doesn't quite work because versions of Git prior to v1.7.0 lack bin-wrappers, so our "run" script doesn't correctly put them in the PATH. Worse, it means we silently find whatever other "git" is in the PATH, and produce test results that have no bearing on what we asked for. Let's fallback to the main git directory when bin-wrappers isn't present. Many modern perf scripts won't run with such an antique version of Git, of course, but at least those failures are detected and reported (and you're free to write a limited perf script that works across many versions). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 83d4a40 commit 28e1fb5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

t/perf/run

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ run_dirs_helper () {
6363
unset GIT_TEST_INSTALLED
6464
else
6565
GIT_TEST_INSTALLED="$mydir/bin-wrappers"
66+
# Older versions of git lacked bin-wrappers; fallback to the
67+
# files in the root.
68+
test -d "$GIT_TEST_INSTALLED" || GIT_TEST_INSTALLED=$mydir
6669
export GIT_TEST_INSTALLED
6770
fi
6871
run_one_dir "$@"

0 commit comments

Comments
 (0)