From: Johannes Schindelin Date: Fri, 22 Dec 2017 23:56:00 +0000 (+0100) Subject: sequencer: do not invent whitespace when transforming OIDs X-Git-Tag: v2.16.0-rc1~1^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c7b4d79c7dd1a20feb88c2e2ed1fd86bd2ea0570;p=git sequencer: do not invent whitespace when transforming OIDs For commands that do not have an argument, there is no need to append a trailing space at the end of the line. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- diff --git a/sequencer.c b/sequencer.c index b005e412a5..4d3f60594c 100644 --- a/sequencer.c +++ b/sequencer.c @@ -2586,7 +2586,10 @@ int transform_todos(unsigned flags) strbuf_addf(&buf, " %s", oid); } /* add all the rest */ - strbuf_addf(&buf, " %.*s\n", item->arg_len, item->arg); + if (!item->arg_len) + strbuf_addch(&buf, '\n'); + else + strbuf_addf(&buf, " %.*s\n", item->arg_len, item->arg); } i = write_message(buf.buf, buf.len, todo_file, 0);