Signed-off-by: Samuel Lijin <sxlijin@xxxxxxxxx> --- dir.c | 4 ++-- dir.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dir.c b/dir.c index fd445ee9e..6a71683df 100644 --- a/dir.c +++ b/dir.c @@ -1844,7 +1844,7 @@ static enum path_treatment read_directory_recursive(struct dir_struct *dir, return dir_state; } -static int cmp_name(const void *p1, const void *p2) +int cmp_name(const void *p1, const void *p2) { const struct dir_entry *e1 = *(const struct dir_entry **)p1; const struct dir_entry *e2 = *(const struct dir_entry **)p2; @@ -1853,7 +1853,7 @@ static int cmp_name(const void *p1, const void *p2) } /* check if *out lexically contains *in */ -static int check_contains(const struct dir_entry *out, const struct dir_entry *in) +int check_contains(const struct dir_entry *out, const struct dir_entry *in) { return (out->len < in->len) && (out->name[out->len - 1] == '/') && diff --git a/dir.h b/dir.h index bf23a470a..1ddd8b611 100644 --- a/dir.h +++ b/dir.h @@ -326,6 +326,9 @@ static inline int dir_path_match(const struct dir_entry *ent, has_trailing_dir); } +int cmp_name(const void *p1, const void *p2); +int check_contains(const struct dir_entry *out, const struct dir_entry *in); + void untracked_cache_invalidate_path(struct index_state *, const char *); void untracked_cache_remove_from_index(struct index_state *, const char *); void untracked_cache_add_to_index(struct index_state *, const char *); -- 2.12.2