diff options
author | Calvin Wan <calvinwan@google.com> | 2023-06-06 19:48:43 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-06-12 13:49:36 -0700 |
commit | 787cb8a48ae24ff07fa7c763909bb204bfdc84a7 (patch) | |
tree | 3f5081154dbc5b8fedb73cac218d581065637bcc /builtin/commit.c | |
parent | aba070683295a20bdf4f49146384984961c794b2 (diff) |
strbuf: remove global variable
As a library that only interacts with other primitives, strbuf should
not utilize the comment_line_char global variable within its
functions. Therefore, add an additional parameter for functions that use
comment_line_char and refactor callers to pass it in instead.
strbuf_stripspace() removes the skip_comments boolean and checks if
comment_line_char is a non-NUL character to determine whether to skip
comments or not.
Signed-off-by: Calvin Wan <calvinwan@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
-rw-r--r-- | builtin/commit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index e67c4be221..e002ebf070 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -893,7 +893,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix, s->hints = 0; if (clean_message_contents) - strbuf_stripspace(&sb, 0); + strbuf_stripspace(&sb, '\0'); if (signoff) append_signoff(&sb, ignore_non_trailer(sb.buf, sb.len), 0); |