summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2017-12-22 23:56:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-12-27 20:33:38 (GMT)
commitc7b4d79c7dd1a20feb88c2e2ed1fd86bd2ea0570 (patch)
tree8d1d505e46abc35b4a6ecb09f5239cb23db26c94 /sequencer.c
parent66afa24fb36f15c49aed76be2f04bd23dd0e55c8 (diff)
downloadgit-c7b4d79c7dd1a20feb88c2e2ed1fd86bd2ea0570.zip
git-c7b4d79c7dd1a20feb88c2e2ed1fd86bd2ea0570.tar.gz
git-c7b4d79c7dd1a20feb88c2e2ed1fd86bd2ea0570.tar.bz2
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>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sequencer.c b/sequencer.c
index b005e41..4d3f605 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);