diff options
author | Jeff King <peff@peff.net> | 2022-09-11 01:03:31 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-09-12 08:38:59 -0700 |
commit | c54980ab83661e8e290003fbd5ab44b12e4e77b1 (patch) | |
tree | 0ec7e41434232177aec0c5f2fb040b82676a5014 /transport.c | |
parent | 2a01bdedf87d7cbfc4411ff5059cfe406e1637db (diff) | |
download | git-c54980ab83661e8e290003fbd5ab44b12e4e77b1.tar.gz |
list-objects-filter: convert filter_spec to a strbuf
Originally, the filter_spec field was just a string pointer. In
cf9ceb5a12 (list-objects-filter-options: make filter_spec a string_list,
2019-06-27) it became a string_list, but that commit notes:
A strbuf would seem to be a more natural choice for this object, but
it unfortunately requires initialization besides just zero'ing out
the memory. This results in all container structs, and all
containers of those structs, etc., to also require initialization.
Initializing them all would be more cumbersome that simply using a
string_list, which behaves properly when its contents are zero'd.
Now that we've changed the struct to require non-zero initialization
anyway (ironically, because string_list also needed non-zero
initialization to avoid leaks), we can now convert to that more natural
type.
This makes the list_objects_filter_spec() function much less awkward, as
it had to collapse the string_list to a single-entry list on the fly.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.c')
0 files changed, 0 insertions, 0 deletions