diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-08-03 23:36:09 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-08-03 23:36:09 +0300 |
commit | 4e0d160bbc88c3486ff7ccae179e4730aab5dd28 (patch) | |
tree | 97786123608c06c4f2758c8c0396675e345d1201 /fetch-pack.c | |
parent | 87098a047be46ee69da056336109eee2139c1398 (diff) | |
parent | 0f1eb7d6e976c64c0016d4355200660ce2fdf1ec (diff) |
Merge branch 'rs/mergesort'
Make our mergesort implementation type-safe.
* rs/mergesort:
mergesort: remove llist_mergesort()
packfile: use DEFINE_LIST_SORT
fetch-pack: use DEFINE_LIST_SORT
commit: use DEFINE_LIST_SORT
blame: use DEFINE_LIST_SORT
test-mergesort: use DEFINE_LIST_SORT
test-mergesort: use DEFINE_LIST_SORT_DEBUG
mergesort: add macros for typed sort of linked lists
mergesort: tighten merge loop
mergesort: unify ranks loops
Diffstat (limited to 'fetch-pack.c')
-rw-r--r-- | fetch-pack.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fetch-pack.c b/fetch-pack.c index cb6647d657..e4503774b5 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -26,6 +26,7 @@ #include "commit-reach.h" #include "commit-graph.h" #include "sigchain.h" +#include "mergesort.h" static int transfer_unpack_limit = -1; static int fetch_unpack_limit = -1; @@ -1025,6 +1026,13 @@ static int get_pack(struct fetch_pack_args *args, return 0; } +static int ref_compare_name(const struct ref *a, const struct ref *b) +{ + return strcmp(a->name, b->name); +} + +DEFINE_LIST_SORT(static, sort_ref_list, struct ref, next); + static int cmp_ref_by_name(const void *a_, const void *b_) { const struct ref *a = *((const struct ref **)a_); |