summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-04-25 12:28:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-26 03:28:42 (GMT)
commit2f6b1d13aa730901fe328fc2d88f208ea44d4f9e (patch)
treee7872b7efef0b7a76a8a6e894eaa13ecf4b63237 /sequencer.c
parentbf5c0571d6542d992380467c26cb7bdcab23fcb5 (diff)
downloadgit-2f6b1d13aa730901fe328fc2d88f208ea44d4f9e.zip
git-2f6b1d13aa730901fe328fc2d88f208ea44d4f9e.tar.gz
git-2f6b1d13aa730901fe328fc2d88f208ea44d4f9e.tar.bz2
sequencer: make rearrange_squash() a bit more obvious
There are some commands that have to be skipped from rearranging by virtue of not handling any commits. However, the logic was not quite obvious: it skipped commands based on their position in the enum todo_command. Instead, let's make it explicit that we skip all commands that do not handle any commit. With one exception: the `drop` command, because it, well, drops the commit and is therefore not eligible to rearranging. Note: this is a bit academic at the moment because the only time we call `rearrange_squash()` is directly after generating the todo list, when we have nothing but `pick` commands anyway. However, the upcoming `merge` command *will* want to be handled by that function, and it *can* handle commits. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sequencer.c b/sequencer.c
index 674e26b..c131e39 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -3403,7 +3403,7 @@ int rearrange_squash(void)
struct subject2item_entry *entry;
next[i] = tail[i] = -1;
- if (item->command >= TODO_EXEC) {
+ if (!item->commit || item->command == TODO_DROP) {
subjects[i] = NULL;
continue;
}