[PATCH 5/5] sequencer: do not invent whitespace when transforming OIDs
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Dec 22, 2017, 23:56 UTC
- Message-ID
- <da288dac49ac1e54db99349a50a7cd684956671c.1513986836.git.johannes.schindelin@gmx.de>
- In-Reply-To
- <cover.1513986836.git.johannes.schindelin@gmx.de>
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> --- sequencer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sequencer.c b/sequencer.c index 5632415ea2d..970842e3fcc 100644 --- a/sequencer.c +++ b/sequencer.c @@ -2584,7 +2584,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);
-- 2.15.1.windows.2