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/rebase.c | |
| parent | aba070683295a20bdf4f49146384984961c794b2 (diff) | |
| download | git-787cb8a48ae24ff07fa7c763909bb204bfdc84a7.tar.gz | |
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/rebase.c')
| -rw-r--r-- | builtin/rebase.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c index ace1d5e8d1..b1ba9fb05d 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -209,7 +209,7 @@ static int edit_todo_file(unsigned flags) if (strbuf_read_file(&todo_list.buf, todo_file, 0) < 0) return error_errno(_("could not read '%s'."), todo_file); - strbuf_stripspace(&todo_list.buf, 1); + strbuf_stripspace(&todo_list.buf, comment_line_char); res = edit_todo_list(the_repository, &todo_list, &new_todo, NULL, NULL, flags); if (!res && todo_list_write_to_file(the_repository, &new_todo, todo_file, NULL, NULL, -1, flags & ~(TODO_LIST_SHORTEN_IDS))) |
