diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-05-30 11:16:40 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-30 11:16:41 +0900 |
commit | 140921ca21f7ac35af07755e35205d6065b434be (patch) | |
tree | e41ecb20e3b118015aedf284dbbc6825dbdd8364 /t/perf/perf-lib.sh | |
parent | Merge branch 'bw/pathspec-sans-the-index' (diff) | |
parent | perf: add test showing exponential growth in path globbing (diff) | |
download | tgif-140921ca21f7ac35af07755e35205d6065b434be.tar.xz |
Merge branch 'ab/perf-wildmatch'
Add perf-test for wildmatch.
* ab/perf-wildmatch:
perf: add test showing exponential growth in path globbing
perf: add function to setup a fresh test repo
Diffstat (limited to 't/perf/perf-lib.sh')
-rw-r--r-- | t/perf/perf-lib.sh | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh index ab4b8b06ae..b6fc880395 100644 --- a/t/perf/perf-lib.sh +++ b/t/perf/perf-lib.sh @@ -78,6 +78,10 @@ if test -z "$GIT_PERF_LARGE_REPO"; then GIT_PERF_LARGE_REPO=$TEST_DIRECTORY/.. fi +test_perf_do_repo_symlink_config_ () { + test_have_prereq SYMLINKS || git config core.symlinks false +} + test_perf_create_repo_from () { test "$#" = 2 || error "bug in the test script: not 2 parameters to test-create-repo" @@ -102,15 +106,22 @@ test_perf_create_repo_from () { ) && ( cd "$repo" && - "$MODERN_GIT" init -q && { - test_have_prereq SYMLINKS || - git config core.symlinks false - } && + "$MODERN_GIT" init -q && + test_perf_do_repo_symlink_config_ && mv .git/hooks .git/hooks-disabled 2>/dev/null ) || error "failed to copy repository '$source' to '$repo'" } # call at least one of these to establish an appropriately-sized repository +test_perf_fresh_repo () { + repo="${1:-$TRASH_DIRECTORY}" + "$MODERN_GIT" init -q "$repo" && + ( + cd "$repo" && + test_perf_do_repo_symlink_config_ + ) +} + test_perf_default_repo () { test_perf_create_repo_from "${1:-$TRASH_DIRECTORY}" "$GIT_PERF_REPO" } |