Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-07-06 21:54:46 +0300
committerJunio C Hamano <gitster@pobox.com>2023-07-06 21:54:46 +0300
commit67e7305e64fea8d15879e9dc3831fc8e31cfe619 (patch)
treed8ed9ee0a2b54f3df4619af5757d938bb5247986 /builtin/tag.c
parentda269af9207e38e820daad8aa993caa7d2fad76c (diff)
parent787cb8a48ae24ff07fa7c763909bb204bfdc84a7 (diff)
Merge branch 'cw/strbuf-cleanup'
Move functions that are not about pure string manipulation out of strbuf.[ch] * cw/strbuf-cleanup: strbuf: remove global variable path: move related function to path object-name: move related functions to object-name credential-store: move related functions to credential-store file abspath: move related functions to abspath strbuf: clarify dependency strbuf: clarify API boundary
Diffstat (limited to 'builtin/tag.c')
-rw-r--r--builtin/tag.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/builtin/tag.c b/builtin/tag.c
index e63bee8eab..afb6c121ab 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -309,9 +309,11 @@ static void create_tag(const struct object_id *object, const char *object_ref,
struct strbuf buf = STRBUF_INIT;
strbuf_addch(&buf, '\n');
if (opt->cleanup_mode == CLEANUP_ALL)
- strbuf_commented_addf(&buf, _(tag_template), tag, comment_line_char);
+ strbuf_commented_addf(&buf, comment_line_char,
+ _(tag_template), tag, comment_line_char);
else
- strbuf_commented_addf(&buf, _(tag_template_nocleanup), tag, comment_line_char);
+ strbuf_commented_addf(&buf, comment_line_char,
+ _(tag_template_nocleanup), tag, comment_line_char);
write_or_die(fd, buf.buf, buf.len);
strbuf_release(&buf);
}
@@ -325,7 +327,8 @@ static void create_tag(const struct object_id *object, const char *object_ref,
}
if (opt->cleanup_mode != CLEANUP_NONE)
- strbuf_stripspace(buf, opt->cleanup_mode == CLEANUP_ALL);
+ strbuf_stripspace(buf,
+ opt->cleanup_mode == CLEANUP_ALL ? comment_line_char : '\0');
if (!opt->message_given && !buf->len)
die(_("no tag message?"));