diff options
| author | Junio C Hamano <gitster@pobox.com> | 2023-07-06 11:54:46 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-07-06 11:54:46 -0700 |
| commit | 67e7305e64fea8d15879e9dc3831fc8e31cfe619 (patch) | |
| tree | d8ed9ee0a2b54f3df4619af5757d938bb5247986 /builtin/tag.c | |
| parent | Merge branch 'rs/strbuf-expand-step' (diff) | |
| parent | strbuf: remove global variable (diff) | |
| download | git-67e7305e64fea8d15879e9dc3831fc8e31cfe619.tar.gz git-67e7305e64fea8d15879e9dc3831fc8e31cfe619.zip | |
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.c | 9 |
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?")); |
