summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-04-25 04:28:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-25 04:28:49 (GMT)
commitd892beef52a293b271538481dbc76014672ddf09 (patch)
treee9f7896908c60aff2a25a6fe4ac327aaaa6d6974 /sequencer.c
parent18a6a8571fa150441de06e007e9c61856bfadc5d (diff)
parent3d946165e1177905103a25aeb374e018c510e540 (diff)
downloadgit-d892beef52a293b271538481dbc76014672ddf09.zip
git-d892beef52a293b271538481dbc76014672ddf09.tar.gz
git-d892beef52a293b271538481dbc76014672ddf09.tar.bz2
Merge branch 'pw/rebase-keep-empty-fixes'
"git rebase --keep-empty" still removed an empty commit if the other side contained an empty commit (due to the "does an equivalent patch exist already?" check), which has been corrected. * pw/rebase-keep-empty-fixes: rebase: respect --no-keep-empty rebase -i --keep-empty: don't prune empty commits rebase --root: stop assuming squash_onto is unset
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sequencer.c b/sequencer.c
index 667f35e..eedd45e 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -3001,7 +3001,7 @@ int sequencer_make_script(FILE *out, int argc, const char **argv,
init_revisions(&revs, NULL);
revs.verbose_header = 1;
revs.max_parents = 1;
- revs.cherry_pick = 1;
+ revs.cherry_mark = 1;
revs.limited = 1;
revs.reverse = 1;
revs.right_only = 1;
@@ -3026,8 +3026,12 @@ int sequencer_make_script(FILE *out, int argc, const char **argv,
return error(_("make_script: error preparing revisions"));
while ((commit = get_revision(&revs))) {
+ int is_empty = is_original_commit_empty(commit);
+
+ if (!is_empty && (commit->object.flags & PATCHSAME))
+ continue;
strbuf_reset(&buf);
- if (!keep_empty && is_original_commit_empty(commit))
+ if (!keep_empty && is_empty)
strbuf_addf(&buf, "%c ", comment_line_char);
strbuf_addf(&buf, "%s %s ", insn,
oid_to_hex(&commit->object.oid));