aboutsummaryrefslogtreecommitdiff
path: root/gitk-git
diff options
context:
space:
mode:
authorDeveshi Dwivedi <deveshigurgaon@gmail.com>2026-03-11 17:33:36 +0000
committerJunio C Hamano <gitster@pobox.com>2026-03-11 11:08:53 -0700
commitf21967e5415673824d501b318a252c6e8a91d6fb (patch)
treea046b36e90e1ca37dba24bc77f9cd650b12d2c94 /gitk-git
parent4107c0bb3455905aeacdba3be09b20e62b310eaa (diff)
downloadgit-f21967e5415673824d501b318a252c6e8a91d6fb.tar.xz
list-objects-filter-options: avoid strbuf_split_str()
parse_combine_filter() splits a combine: filter spec at '+' using strbuf_split_str(), which yields an array of strbufs with the delimiter left at the end of each non-final piece. The code then mutates each non-final piece to strip the trailing '+' before parsing. Allocating an array of strbufs is unnecessary. The function processes one sub-spec at a time and does not use strbuf editing on the pieces. The two helpers it calls, has_reserved_character() and parse_combine_subfilter(), only read the string content of the strbuf they receive. Walk the input string directly with strchrnul() to find each '+', copying each sub-spec into a reusable temporary buffer. The '+' delimiter is naturally excluded. Empty sub-specs (e.g. from a trailing '+') are silently skipped for consistency. Change the helpers to take const char * instead of struct strbuf *. The test that expected an error on a trailing '+' is removed, since that behavior was incorrect. Signed-off-by: Deveshi Dwivedi <deveshigurgaon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitk-git')
0 files changed, 0 insertions, 0 deletions