aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-11-23 11:22:24 +0900
committerJunio C Hamano <gitster@pobox.com>2022-11-23 11:22:25 +0900
commit2fe427ecb75167929b34ef340e9ee07ea1b57f2a (patch)
tree57b2e0ba5b118292922ec95dedf244628008344d
parentMerge branch 'tb/howto-maintain-git-fixes' (diff)
parentnotes: avoid empty line in template (diff)
downloadgit-2fe427ecb75167929b34ef340e9ee07ea1b57f2a.tar.gz
git-2fe427ecb75167929b34ef340e9ee07ea1b57f2a.zip
Merge branch 'mg/notes-newline'
Avoid a stray empty newline in the template when creating new notes. * mg/notes-newline: notes: avoid empty line in template
-rw-r--r--builtin/notes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/notes.c b/builtin/notes.c
index be51f69225..80d9dfd25c 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -181,7 +181,7 @@ static void prepare_note_data(const struct object_id *object, struct note_data *
strbuf_addch(&buf, '\n');
strbuf_add_commented_lines(&buf, "\n", strlen("\n"));
strbuf_add_commented_lines(&buf, _(note_template), strlen(_(note_template)));
- strbuf_addch(&buf, '\n');
+ strbuf_add_commented_lines(&buf, "\n", strlen("\n"));
write_or_die(fd, buf.buf, buf.len);
write_commented_object(fd, object);