diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-08-01 15:04:17 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-08-01 15:24:31 -0700 |
| commit | 4f9c8d896397a1748132060d3465e8573c861633 (patch) | |
| tree | ea50ca61cae8307abd601f990debae4cdf72c7c9 /string-list.c | |
| parent | e813a0200a7121b97fec535f0d0b460b0a33356c (diff) | |
| download | git-4f9c8d896397a1748132060d3465e8573c861633.tar.gz | |
string-list: report programming error with BUG
Passing a string list that has .strdup_strings bit unset to
string_list_split(), or one that has .strdup_strings bit set to
string_list_split_in_place(), is a programmer error. Do not use
die() to abort the execution. Use BUG() instead.
As a developer-facing message, the message string itself should
be a lot more concise, but let's keep the original one for now.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'string-list.c')
| -rw-r--r-- | string-list.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/string-list.c b/string-list.c index 53faaa8420..0cb920e9b0 100644 --- a/string-list.c +++ b/string-list.c @@ -283,7 +283,7 @@ int string_list_split(struct string_list *list, const char *string, const char *p = string, *end; if (!list->strdup_strings) - die("internal error in string_list_split(): " + BUG("internal error in string_list_split(): " "list->strdup_strings must be set"); for (;;) { count++; @@ -309,7 +309,7 @@ int string_list_split_in_place(struct string_list *list, char *string, char *p = string, *end; if (list->strdup_strings) - die("internal error in string_list_split_in_place(): " + BUG("internal error in string_list_split_in_place(): " "list->strdup_strings must not be set"); for (;;) { count++; |
