Skip to content

Commit e0c74e6

Browse files
committed
Merge branch 'jt/perf-updates' into maint
The t/perf performance test suite was not prepared to test not so old versions of Git, but now it covers versions of Git that are not so ancient. * jt/perf-updates: t/perf: add fallback for pre-bin-wrappers versions of git t/perf: use $MODERN_GIT for all repo-copying steps t/perf: export variable used in other blocks
2 parents cd27bc7 + 28e1fb5 commit e0c74e6

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

t/perf/p0001-rev-list.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ test_perf 'rev-list --all --objects' '
1515
'
1616

1717
test_expect_success 'create new unreferenced commit' '
18-
commit=$(git commit-tree HEAD^{tree} -p HEAD)
18+
commit=$(git commit-tree HEAD^{tree} -p HEAD) &&
19+
test_export commit
1920
'
2021

2122
test_perf 'rev-list $commit --not --all' '

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
} &&

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)