]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ac/string-list-sort-u-and-tests'
authorJunio C Hamano <gitster@pobox.com>
Mon, 9 Feb 2026 20:09:10 +0000 (12:09 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Feb 2026 20:09:10 +0000 (12:09 -0800)
The string_list API gains a new helper, string_list_sort_u(), and
new unit tests to extend coverage.

* ac/string-list-sort-u-and-tests:
  string-list: add string_list_sort_u() that mimics "sort -u"
  u-string-list: add unit tests for string-list methods

1  2 
builtin/sparse-checkout.c

index 7dfb276bf01431b9430693b7b005a49671f20eb7,25de7692c91b2dfbfacc46224862fd01bf6a486b..cccf63033190d2c8b6358dee226673f73e2d31fe
@@@ -290,11 -289,10 +290,10 @@@ static void write_cone_to_file(FILE *fp
                if (!hashmap_contains_parent(&pl->recursive_hashmap,
                                             pe->pattern,
                                             &parent_pattern))
 -                      string_list_insert(&sl, pe->pattern);
 +                      string_list_append(&sl, pe->pattern);
        }
  
-       string_list_sort(&sl);
-       string_list_remove_duplicates(&sl, 0);
+       string_list_sort_u(&sl, 0);
  
        fprintf(fp, "/*\n!/*/\n");