diff options
Diffstat (limited to 'sequencer.c')
-rw-r--r-- | sequencer.c | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/sequencer.c b/sequencer.c index a03d4fa252..c4f4b7d571 100644 --- a/sequencer.c +++ b/sequencer.c @@ -252,7 +252,7 @@ static int fast_forward_to(const unsigned char *to, const unsigned char *from, if (!transaction || ref_transaction_update(transaction, "HEAD", to, unborn ? null_sha1 : from, - 0, 1, sb.buf, &err) || + 0, sb.buf, &err) || ref_transaction_commit(transaction, &err)) { ref_transaction_free(transaction); error("%s", err.buf); @@ -267,6 +267,23 @@ static int fast_forward_to(const unsigned char *to, const unsigned char *from, return 0; } +void append_conflicts_hint(struct strbuf *msgbuf) +{ + int i; + + strbuf_addch(msgbuf, '\n'); + strbuf_commented_addf(msgbuf, "Conflicts:\n"); + for (i = 0; i < active_nr;) { + const struct cache_entry *ce = active_cache[i++]; + if (ce_stage(ce)) { + strbuf_commented_addf(msgbuf, "\t%s\n", ce->name); + while (i < active_nr && !strcmp(ce->name, + active_cache[i]->name)) + i++; + } + } +} + static int do_recursive_merge(struct commit *base, struct commit *next, const char *base_label, const char *next_label, unsigned char *head, struct strbuf *msgbuf, @@ -307,21 +324,8 @@ static int do_recursive_merge(struct commit *base, struct commit *next, if (opts->signoff) append_signoff(msgbuf, 0, 0); - if (!clean) { - int i; - strbuf_addstr(msgbuf, "\nConflicts:\n"); - for (i = 0; i < active_nr;) { - const struct cache_entry *ce = active_cache[i++]; - if (ce_stage(ce)) { - strbuf_addch(msgbuf, '\t'); - strbuf_addstr(msgbuf, ce->name); - strbuf_addch(msgbuf, '\n'); - while (i < active_nr && !strcmp(ce->name, - active_cache[i]->name)) - i++; - } - } - } + if (!clean) + append_conflicts_hint(msgbuf); return !clean; } @@ -369,6 +373,7 @@ static int run_git_commit(const char *defmsg, struct replay_opts *opts, { struct argv_array array; int rc; + const char *value; argv_array_init(&array); argv_array_push(&array, "commit"); @@ -381,6 +386,10 @@ static int run_git_commit(const char *defmsg, struct replay_opts *opts, if (!opts->edit) { argv_array_push(&array, "-F"); argv_array_push(&array, defmsg); + if (!opts->signoff && + !opts->record_origin && + git_config_get_value("commit.cleanup", &value)) + argv_array_push(&array, "--cleanup=verbatim"); } if (allow_empty) |