Web lists-archives.com

[PATCH 1/2] rebase -i: fix reflog message

From: Phillip Wood <phillip.wood@xxxxxxxxxxxxx>

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@xxxxxxxxxxxxx>
 sequencer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sequencer.c b/sequencer.c
index 0fa3fb14f7c1df5f11ba0ef7e4e46a44a32817bd..f8bc18badf1a3fb1b39656501c5a316e229968d2 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -2089,6 +2089,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;