diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-08-21 13:46:59 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-08-21 13:46:59 -0700 |
| commit | 971ba42dd426f2531d5448488bcd3bd3282e6999 (patch) | |
| tree | 90b087657b1dfcc37763734ad7b749e13bd2cab3 /notes.c | |
| parent | 5a404a70c789707225d5c402510dd3d2e777f43a (diff) | |
| parent | 2ab2aac73d234ae75096e2186b07cc14c57d2586 (diff) | |
Merge branch 'jc/string-list-split'
string_list_split*() family of functions have been extended to
simplify common use cases.
* jc/string-list-split:
string-list: split-then-remove-empty can be done while splitting
string-list: optionally omit empty string pieces in string_list_split*()
diff: simplify parsing of diff.colormovedws
string-list: optionally trim string pieces split by string_list_split*()
string-list: unify string_list_split* functions
string-list: align string_list_split() with its _in_place() counterpart
string-list: report programming error with BUG
Diffstat (limited to 'notes.c')
| -rw-r--r-- | notes.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -894,7 +894,7 @@ static int string_list_add_note_lines(struct string_list *list, * later, along with any empty strings that came from empty * lines within the file. */ - string_list_split(list, data, '\n', -1); + string_list_split(list, data, "\n", -1); free(data); return 0; } @@ -973,8 +973,8 @@ void string_list_add_refs_from_colon_sep(struct string_list *list, char *globs_copy = xstrdup(globs); int i; - string_list_split_in_place(&split, globs_copy, ":", -1); - string_list_remove_empty_items(&split, 0); + string_list_split_in_place_f(&split, globs_copy, ":", -1, + STRING_LIST_SPLIT_NONEMPTY); for (i = 0; i < split.nr; i++) string_list_add_refs_by_glob(list, split.items[i].string); |
