From 33c297aacc0ce0f945198fbcdf48fbf2fd27d01b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Mon, 28 Apr 2014 17:55:24 +0700 Subject: sequencer: do not update/refresh index if the lock cannot be held MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano diff --git a/sequencer.c b/sequencer.c index bde5f04..7b886a6 100644 --- a/sequencer.c +++ b/sequencer.c @@ -679,7 +679,7 @@ static void read_and_refresh_cache(struct replay_opts *opts) if (read_index_preload(&the_index, NULL) < 0) die(_("git %s: failed to read the index"), action_name(opts)); refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, NULL, NULL, NULL); - if (the_index.cache_changed) { + if (the_index.cache_changed && index_fd >= 0) { if (write_index(&the_index, index_fd) || commit_locked_index(&index_lock)) die(_("git %s: failed to refresh the index"), action_name(opts)); -- cgit v0.10.2-6-g49f6