Skip to content

Commit 83d4a40

Browse files
peffgitster
authored andcommitted
t/perf: use $MODERN_GIT for all repo-copying steps
Since 1a0962d (t/perf: fix regression in testing older versions of git, 2016-06-22), we point "$MODERN_GIT" to a copy of git that matches the t/perf script itself, and which can be used for tasks outside of the actual timings. This is needed because the setup done by perf scripts keeps moving forward in time, and may use features that the older versions of git we are testing do not have. That commit used $MODERN_GIT to fix a case where we relied on the relatively recent --git-path option. But if you go back further still, there are more problems. Since 7501b59 (perf: make the tests work in worktrees, 2016-05-13), we use "git -C", but versions of git older than 44e1e4d (git: run in a directory given with -C option, 2013-09-09) don't know about "-C". So testing an old version of git with a new version of t/perf will fail the setup step. We can fix this by using $MODERN_GIT during the setup; there's no need to use the antique version, since it doesn't affect the timings. Likewise, we'll adjust the "init" invocation; antique versions of git called this "init-db". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 67f2825 commit 83d4a40

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/perf/perf-lib.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ test_perf_create_repo_from () {
8383
error "bug in the test script: not 2 parameters to test-create-repo"
8484
repo="$1"
8585
source="$2"
86-
source_git="$(git -C "$source" rev-parse --git-dir)"
86+
source_git="$("$MODERN_GIT" -C "$source" rev-parse --git-dir)"
8787
objects_dir="$("$MODERN_GIT" -C "$source" rev-parse --git-path objects)"
8888
mkdir -p "$repo/.git"
8989
(
@@ -102,7 +102,7 @@ test_perf_create_repo_from () {
102102
) &&
103103
(
104104
cd "$repo" &&
105-
git init -q && {
105+
"$MODERN_GIT" init -q && {
106106
test_have_prereq SYMLINKS ||
107107
git config core.symlinks false
108108
} &&

0 commit comments

Comments
 (0)