diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-03-28 13:52:19 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-28 13:52:19 -0700 |
commit | e0c74e6f38177dd9bfa7eb2b848530020b251149 (patch) | |
tree | 440119b55bdaded68337a3cd2427809074fa4097 | |
parent | Merge branch 'rs/strbuf-add-real-path' into maint (diff) | |
parent | t/perf: add fallback for pre-bin-wrappers versions of git (diff) | |
download | tgif-e0c74e6f38177dd9bfa7eb2b848530020b251149.tar.xz |
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
-rwxr-xr-x | t/perf/p0001-rev-list.sh | 3 | ||||
-rw-r--r-- | t/perf/perf-lib.sh | 4 | ||||
-rwxr-xr-x | t/perf/run | 3 |
3 files changed, 7 insertions, 3 deletions
diff --git a/t/perf/p0001-rev-list.sh b/t/perf/p0001-rev-list.sh index 16359d51ae..ebf172401b 100755 --- a/t/perf/p0001-rev-list.sh +++ b/t/perf/p0001-rev-list.sh @@ -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' ' diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh index 46f08ee087..ab4b8b06ae 100644 --- a/t/perf/perf-lib.sh +++ b/t/perf/perf-lib.sh @@ -83,7 +83,7 @@ test_perf_create_repo_from () { error "bug in the test script: not 2 parameters to test-create-repo" repo="$1" source="$2" - source_git="$(git -C "$source" rev-parse --git-dir)" + source_git="$("$MODERN_GIT" -C "$source" rev-parse --git-dir)" objects_dir="$("$MODERN_GIT" -C "$source" rev-parse --git-path objects)" mkdir -p "$repo/.git" ( @@ -102,7 +102,7 @@ test_perf_create_repo_from () { ) && ( cd "$repo" && - git init -q && { + "$MODERN_GIT" init -q && { test_have_prereq SYMLINKS || git config core.symlinks false } && diff --git a/t/perf/run b/t/perf/run index e8adedadfd..c788d713ae 100755 --- a/t/perf/run +++ b/t/perf/run @@ -63,6 +63,9 @@ run_dirs_helper () { unset GIT_TEST_INSTALLED else GIT_TEST_INSTALLED="$mydir/bin-wrappers" + # Older versions of git lacked bin-wrappers; fallback to the + # files in the root. + test -d "$GIT_TEST_INSTALLED" || GIT_TEST_INSTALLED=$mydir export GIT_TEST_INSTALLED fi run_one_dir "$@" |