Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-05-15 00:39:43 +0300
committerJunio C Hamano <gitster@pobox.com>2020-05-15 00:39:43 +0300
commita2a0942a16a6459d4a52e7ee4ec85f7f90ad5334 (patch)
tree83dcf90fd0897ccf3974021dddd6e48042c89637 /sequencer.c
parent73d9f96b4790e16335a30380f97d46bd065dc07b (diff)
parent02471e7e205c3e6c80f7908877640c0eed526fda (diff)
Merge branch 'js/rebase-autosquash-double-fixup-fix'
"rebase -i" segfaulted when rearranging a sequence that has a fix-up that applies another fix-up (which may or may not be a fix-up of yet another step). * js/rebase-autosquash-double-fixup-fix: rebase --autosquash: fix a potential segfault
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sequencer.c b/sequencer.c
index 9d1b3e7d4f..fd7701c88a 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -5385,10 +5385,13 @@ int todo_list_rearrange_squash(struct todo_list *todo_list)
todo_list->items[i].command =
starts_with(subject, "fixup!") ?
TODO_FIXUP : TODO_SQUASH;
- if (next[i2] < 0)
+ if (tail[i2] < 0) {
+ next[i] = next[i2];
next[i2] = i;
- else
+ } else {
+ next[i] = next[tail[i2]];
next[tail[i2]] = i;
+ }
tail[i2] = i;
} else if (!hashmap_get_from_hash(&subject2item,
strhash(subject), subject)) {