summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-06-19 19:38:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-06-19 19:38:44 (GMT)
commit06959fe0e1f50608ff872be386a7c53d97f885f4 (patch)
treea7d021582dc77fec4031e56d1104e4378eaa1c4b
parenta6f38c109b6e70a1c788581194fc9b8669eea231 (diff)
parent154ffeecc6b13082b06fab96e5de698d606aa790 (diff)
downloadgit-06959fe0e1f50608ff872be386a7c53d97f885f4.zip
git-06959fe0e1f50608ff872be386a7c53d97f885f4.tar.gz
git-06959fe0e1f50608ff872be386a7c53d97f885f4.tar.bz2
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
-rw-r--r--t/perf/perf-lib.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/perf/perf-lib.sh b/t/perf/perf-lib.sh
index b6fc880..b50211b 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'"
}