From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH] perf: work around the tested repo having an index.lock
Date: Fri, 2 Jun 2017 10:33:30 +0000 [thread overview]
Message-ID: <20170602103330.25663-1-avarab@gmail.com> (raw)
When the tested repo has an index.lock file it should be removed. This
file may be present if e.g. git-status previously crashed in that
repo, and it will make a lot of git commands fail. Let's try harder
and remove the lock.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
t/perf/perf-lib.sh | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
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'"
}
--
2.13.0.506.g27d5fe0cd
next reply other threads:[~2017-06-02 10:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-02 10:33 Ævar Arnfjörð Bjarmason [this message]
2017-06-02 18:45 ` [PATCH] perf: work around the tested repo having an index.lock Jeff King
2017-06-02 20:12 ` Ævar Arnfjörð Bjarmason
2017-06-02 23:52 ` Junio C Hamano
2017-06-03 16:24 ` Ævar Arnfjörð Bjarmason
2017-06-04 0:00 ` Junio C Hamano
2017-06-04 0:51 ` Junio C Hamano
2017-06-04 7:37 ` Christian Couder
2017-06-04 7:55 ` Ævar Arnfjörð Bjarmason
2017-06-04 8:23 ` Jeff King
2017-06-05 2:02 ` Junio C Hamano
2017-06-05 6:25 ` Christian Couder
2017-06-04 8:29 ` Jeff King
2017-06-05 2:04 ` Junio C Hamano
2017-06-04 2:04 ` Junio C Hamano
2017-06-04 8:37 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170602103330.25663-1-avarab@gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.