1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-21 22:06:20 +02:00

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>
This commit is contained in:
Johannes Schindelin 2017-12-23 00:56:00 +01:00 committed by Junio C Hamano
parent 66afa24fb3
commit c7b4d79c7d

View File

@ -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);