Skip to content

Commit 89c3bbd

Browse files
ralfthgitster
authored andcommitted
fmt-merge-msg: use core.commentchar in tag signatures completely
Commit eff80a9 (Allow custom "comment char") introduced a custom comment character for commit messages but didn't use it completely in the tag signature part. This commit fixes that. Signed-off-by: Ralf Thielow <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9927ebe commit 89c3bbd

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

builtin/fmt-merge-msg.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,14 +503,18 @@ static void fmt_merge_msg_sigs(struct strbuf *out)
503503
} else {
504504
if (tag_number == 2) {
505505
struct strbuf tagline = STRBUF_INIT;
506-
strbuf_addf(&tagline, "\n# %s\n",
507-
origins.items[first_tag].string);
506+
strbuf_addch(&tagline, '\n');
507+
strbuf_add_commented_lines(&tagline,
508+
origins.items[first_tag].string,
509+
strlen(origins.items[first_tag].string));
508510
strbuf_insert(&tagbuf, 0, tagline.buf,
509511
tagline.len);
510512
strbuf_release(&tagline);
511513
}
512-
strbuf_addf(&tagbuf, "\n# %s\n",
513-
origins.items[i].string);
514+
strbuf_addch(&tagbuf, '\n');
515+
strbuf_add_commented_lines(&tagbuf,
516+
origins.items[i].string,
517+
strlen(origins.items[i].string));
514518
fmt_tag_signature(&tagbuf, &sig, buf, len);
515519
}
516520
strbuf_release(&sig);

0 commit comments

Comments
 (0)