tree: enable cmp_cache_name_compare() to be used elsewhere

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Elijah Newren 2020-12-13 08:04:25 +00:00 committed by Junio C Hamano
parent 6681ce5cf6
commit 70912f66de
2 changed files with 3 additions and 1 deletions

2
tree.c
View File

@ -144,7 +144,7 @@ int read_tree_recursive(struct repository *r,
return ret;
}
static int cmp_cache_name_compare(const void *a_, const void *b_)
int cmp_cache_name_compare(const void *a_, const void *b_)
{
const struct cache_entry *ce1, *ce2;

2
tree.h
View File

@ -28,6 +28,8 @@ void free_tree_buffer(struct tree *tree);
/* Parses and returns the tree in the given ent, chasing tags and commits. */
struct tree *parse_tree_indirect(const struct object_id *oid);
int cmp_cache_name_compare(const void *a_, const void *b_);
#define READ_TREE_RECURSIVE 1
typedef int (*read_tree_fn_t)(const struct object_id *, struct strbuf *, const char *, unsigned int, int, void *);