]> git.ipfire.org Git - thirdparty/git.git/commitdiff
sequencer: reschedule pick if index can't be locked
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Wed, 15 Nov 2017 10:41:25 +0000 (10:41 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Nov 2017 05:19:12 +0000 (14:19 +0900)
If the index cannot be locked in do_recursive_merge(), issue an
error message and go on to the error recovery codepath, instead of
dying.  When the commit cannot be picked, it needs to be rescheduled
when performing an interactive rebase, but just dying there won't
allow that to happen, and when the user runs 'git rebase --continue'
rather than 'git rebase --abort', the commit gets silently dropped.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
sequencer.c

index 332a383b037d2a24627a2c833aae163dc05665f8..10924ffd4962cf46cafc3f81ffd64e89c01c3649 100644 (file)
@@ -438,7 +438,8 @@ static int do_recursive_merge(struct commit *base, struct commit *next,
        char **xopt;
        static struct lock_file index_lock;
 
-       hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);
+       if (hold_locked_index(&index_lock, LOCK_REPORT_ON_ERROR) < 0)
+               return -1;
 
        read_cache();