diff options
author | Jeff King <peff@peff.net> | 2024-03-12 10:17:34 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-03-12 21:28:10 +0100 |
commit | f99e1d94f5ed72fd7c5115a814b1087fde919fe5 (patch) | |
tree | 4993814ec63e24425c428658406c9bc76ab4d240 /add-patch.c | |
parent | strbuf: accept a comment string for strbuf_add_commented_lines() (diff) | |
download | git-f99e1d94f5ed72fd7c5115a814b1087fde919fe5.tar.xz git-f99e1d94f5ed72fd7c5115a814b1087fde919fe5.zip |
prefer comment_line_str to comment_line_char for printing
As part of our transition to multi-byte comment characters, we should
use the string variable rather than the historical character variable.
All of the sites adjusted here are just swapping out "%c" for "%s" in
format strings, or strbuf_addch() for strbuf_addstr(). The type system
and printf-attribute give the compiler enough information to make sure
our formats and variable changes all match (especially important for
cases where the format string is defined far away from its use, like
prepare_to_commit() in commit.c).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'add-patch.c')
-rw-r--r-- | add-patch.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/add-patch.c b/add-patch.c index 7390677795..4a10237d50 100644 --- a/add-patch.c +++ b/add-patch.c @@ -1114,10 +1114,10 @@ static int edit_hunk_manually(struct add_p_state *s, struct hunk *hunk) "To remove '%c' lines, make them ' ' lines " "(context).\n" "To remove '%c' lines, delete them.\n" - "Lines starting with %c will be removed.\n"), + "Lines starting with %s will be removed.\n"), s->mode->is_reverse ? '+' : '-', s->mode->is_reverse ? '-' : '+', - comment_line_char); + comment_line_str); strbuf_commented_addf(&s->buf, comment_line_str, "%s", _(s->mode->edit_hunk_hint)); /* |