Skip to content

Commit c7b4d79

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 66afa24 commit c7b4d79

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sequencer.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2586,7 +2586,10 @@ int transform_todos(unsigned flags)
25862586
strbuf_addf(&buf, " %s", oid);
25872587
}
25882588
/* 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);
25902593
}
25912594

25922595
i = write_message(buf.buf, buf.len, todo_file, 0);

0 commit comments

Comments
 (0)