diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-06-19 22:38:44 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-19 22:38:44 +0300 |
commit | 06959fe0e1f50608ff872be386a7c53d97f885f4 (patch) | |
tree | a7d021582dc77fec4031e56d1104e4378eaa1c4b /t | |
parent | a6f38c109b6e70a1c788581194fc9b8669eea231 (diff) | |
parent | 154ffeecc6b13082b06fab96e5de698d606aa790 (diff) |
Merge branch 'ab/perf-remove-index-lock'
When an existing repository is used for t/perf testing, we first
create bit-for-bit copy of it, which may grab a transient state of
the repository and freeze it into the repository used for testing,
which then may cause Git operations to fail. Single out "the index
being locked" case and forcibly drop the lock from the copy.
* ab/perf-remove-index-lock:
perf: work around the tested repo having an index.lock
Diffstat (limited to 't')
-rw-r--r-- | t/perf/perf-lib.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh index b6fc880395..b50211b259 100644 --- a/t/perf/perf-lib.sh +++ b/t/perf/perf-lib.sh @@ -108,7 +108,14 @@ test_perf_create_repo_from () { cd "$repo" && "$MODERN_GIT" init -q && test_perf_do_repo_symlink_config_ && - mv .git/hooks .git/hooks-disabled 2>/dev/null + mv .git/hooks .git/hooks-disabled 2>/dev/null && + if test -f .git/index.lock + then + # We may be copying a repo that can't run "git + # status" due to a locked index. Since we have + # a copy it's fine to remove the lock. + rm .git/index.lock + fi ) || error "failed to copy repository '$source' to '$repo'" } |