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
This commit is contained in:
Junio C Hamano 2017-06-19 12:38:44 -07:00
commit 06959fe0e1

View file

@ -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'"
}