rebase -i: fix reflog message
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Thu, 18 May 2017 10:02:32 +0000 (11:02 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 20 May 2017 09:24:25 +0000 (18:24 +0900)
When rebase -i was converted to C a bug was introduced into the code
that creates the reflog message. Instead of saying
rebase -i (finish): <head-name> onto <onto>
it says
rebase -i (finish): <head-name> onto <orig-head><onto>
as the strbuf is not reset between reading the value of <orig-head>
and <onto>.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c
index d76dc9cb2b07227d311e4a667aaa5f0d305da45d..907319d08945dc54d2fe710f0d8f5e9213b4bb35 100644 (file)
@@ -2058,6 +2058,7 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
                                res = error(_("could not read orig-head"));
                                goto cleanup_head_ref;
                        }
+                       strbuf_reset(&buf);
                        if (!read_oneliner(&buf, rebase_path_onto(), 0)) {
                                res = error(_("could not read 'onto'"));
                                goto cleanup_head_ref;