Skip to content

Commit bd58886

Browse files
phillipwoodgitster
authored andcommitted
sequencer: reschedule pick if index can't be locked
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 <[email protected]>
1 parent 5a1f5c3 commit bd58886

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sequencer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,8 @@ static int do_recursive_merge(struct commit *base, struct commit *next,
438438
char **xopt;
439439
static struct lock_file index_lock;
440440

441-
hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);
441+
if (hold_locked_index(&index_lock, LOCK_REPORT_ON_ERROR) < 0)
442+
return -1;
442443

443444
read_cache();
444445

0 commit comments

Comments
 (0)