Change the scope of the function 'directory_exists_in_index()' as well as declare it in 'dir.h'. Since the return type of the function is the enumerator 'exist_status', change its scope as well and declare it in 'dir.h'. Helped-by: Christian Couder <christian.couder@xxxxxxxxx> Helped-by: Kaartic Sivaraam <kaartic.sivaraam@xxxxxxxxx> Signed-off-by: Shourya Shukla <shouryashukla.oo@xxxxxxxxx> --- dir.c | 10 ++-------- dir.h | 9 +++++++++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/dir.c b/dir.c index 78387110e6..e67cf52fec 100644 --- a/dir.c +++ b/dir.c @@ -1655,12 +1655,6 @@ struct dir_entry *dir_add_ignored(struct dir_struct *dir, return dir->ignored[dir->ignored_nr++] = dir_entry_new(pathname, len); } -enum exist_status { - index_nonexistent = 0, - index_directory, - index_gitdir -}; - /* * Do not use the alphabetically sorted index to look up * the directory name; instead, use the case insensitive @@ -1688,8 +1682,8 @@ static enum exist_status directory_exists_in_index_icase(struct index_state *ist * the files it contains) will sort with the '/' at the * end. */ -static enum exist_status directory_exists_in_index(struct index_state *istate, - const char *dirname, int len) +enum exist_status directory_exists_in_index(struct index_state *istate, + const char *dirname, int len) { int pos; diff --git a/dir.h b/dir.h index a3c40dec51..e46f240528 100644 --- a/dir.h +++ b/dir.h @@ -370,6 +370,15 @@ int read_directory(struct dir_struct *, struct index_state *istate, const char *path, int len, const struct pathspec *pathspec); +enum exist_status { + index_nonexistent = 0, + index_directory, + index_gitdir +}; + +enum exist_status directory_exists_in_index(struct index_state *istate, + const char *dirname, int len); + enum pattern_match_result { UNDECIDED = -1, NOT_MATCHED = 0, -- 2.28.0