From ed81c76bc3a9440e37b3512c9c2b742c6ca92c6f Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 21 May 2012 18:19:28 -0400 Subject: add sorting infrastructure for list refs Since we store lists of refs as linked lists, we can use llist_mergesort to efficiently sort them. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- remote.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'remote.h') diff --git a/remote.h b/remote.h index 9ad8eb6cc6..251d8fd965 100644 --- a/remote.h +++ b/remote.h @@ -72,6 +72,8 @@ extern const struct refspec *tag_refspec; struct ref *alloc_ref(const char *name); struct ref *copy_ref(const struct ref *ref); struct ref *copy_ref_list(const struct ref *ref); +void sort_ref_list(struct ref **, int (*cmp)(const void *, const void *)); +int ref_compare_name(const void *, const void *); int check_ref_type(const struct ref *ref, int flags); -- cgit v1.2.1