strbuf: remove global variable
commit787cb8a48ae24ff07fa7c763909bb204bfdc84a7
authorCalvin Wan <calvinwan@google.com>
Tue, 6 Jun 2023 19:48:43 +0000 (6 19:48 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Jun 2023 20:49:36 +0000 (12 13:49 -0700)
tree3f5081154dbc5b8fedb73cac218d581065637bcc
parentaba070683295a20bdf4f49146384984961c794b2
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>
16 files changed:
add-patch.c
builtin/am.c
builtin/branch.c
builtin/commit.c
builtin/merge.c
builtin/notes.c
builtin/rebase.c
builtin/stripspace.c
builtin/tag.c
fmt-merge-msg.c
gpg-interface.c
rebase-interactive.c
sequencer.c
strbuf.c
strbuf.h
wt-status.c