summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2018-08-15 09:41:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-15 17:50:24 (GMT)
commitdd2e36ebaccd6dc2ca4d37759248ce9bbdf9113e (patch)
treea64918927a3d015344978c1628b0556b1adcd1c0 /sequencer.c
parent15ef69314d54945471603223bef00091673b5725 (diff)
downloadgit-dd2e36ebaccd6dc2ca4d37759248ce9bbdf9113e.zip
git-dd2e36ebaccd6dc2ca4d37759248ce9bbdf9113e.tar.gz
git-dd2e36ebaccd6dc2ca4d37759248ce9bbdf9113e.tar.bz2
rebase -i: fix numbering in squash message
Commit e12a7ef597 ("rebase -i: Handle "combination of <n> commits" with GETTEXT_POISON", 2018-04-27) changed the way that individual commit messages are labelled when squashing commits together. In doing so a regression was introduced where the numbering of the messages is off by one. This commit fixes that and adds a test for the numbering. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sequencer.c b/sequencer.c
index 2eb5ec7..77d3c23 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1387,13 +1387,13 @@ static int update_squash_messages(enum todo_command command,
unlink(rebase_path_fixup_msg());
strbuf_addf(&buf, "\n%c ", comment_line_char);
strbuf_addf(&buf, _("This is the commit message #%d:"),
- ++opts->current_fixup_count);
+ ++opts->current_fixup_count + 1);
strbuf_addstr(&buf, "\n\n");
strbuf_addstr(&buf, body);
} else if (command == TODO_FIXUP) {
strbuf_addf(&buf, "\n%c ", comment_line_char);
strbuf_addf(&buf, _("The commit message #%d will be skipped:"),
- ++opts->current_fixup_count);
+ ++opts->current_fixup_count + 1);
strbuf_addstr(&buf, "\n\n");
strbuf_add_commented_lines(&buf, body, strlen(body));
} else