Skip to content

Commit

Permalink
sequencer: do not update/refresh index if the lock cannot be held
Browse files Browse the repository at this point in the history
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nguyễn Thái Ngọc Duy authored and Junio C Hamano committed Apr 29, 2014
1 parent 16fc2b7 commit 33c297a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sequencer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 33c297a

Please sign in to comment.