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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Dec 23, 2017 at 00:56 UTC
c7b4d79c7dd1a20feb88c2e2ed1fd86bd2ea0570
1 file changed
+4
-1
sequencer.c
+4
-1
@@ -2586,7 +2586,10 @@ int transform_todos(unsigned flags)
2586
strbuf_addf(&buf, " %s", oid);
2587
}
2588
/* add all the rest */
2589
- strbuf_addf(&buf, " %.*s\n", item->arg_len, item->arg);
2589
+ if (!item->arg_len)
2590
+ strbuf_addch(&buf, '\n');
2591
+ else
2592
+ strbuf_addf(&buf, " %.*s\n", item->arg_len, item->arg);
2593
}
2594
2595
i = write_message(buf.buf, buf.len, todo_file, 0);