diff options
author | Ben Straub <bstraub@github.com> | 2012-07-11 21:40:53 +0400 |
---|---|---|
committer | Ben Straub <bstraub@github.com> | 2012-07-11 21:40:53 +0400 |
commit | d024419f165e81f59d919bd56d84abf8e9fb9f57 (patch) | |
tree | 93c6fe213a8249c8308a3ee607da6af769125d55 /src/path.h | |
parent | c3b5099fe46e1191784cc1890cd35f167305f47a (diff) |
Add git_path_is_empty_dir.
Diffstat (limited to 'src/path.h')
-rw-r--r-- | src/path.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/path.h b/src/path.h index 76e01fc8f..116477043 100644 --- a/src/path.h +++ b/src/path.h @@ -80,7 +80,9 @@ extern int git_path_to_dir(git_buf *path); */ extern void git_path_string_to_dir(char* path, size_t size); -/* Taken from git.git */ +/** + * Taken from git.git; returns nonzero if the given path is "." or "..". + */ GIT_INLINE(int) git_path_is_dot_or_dotdot(const char *name) { return (name[0] == '.' && @@ -138,6 +140,11 @@ extern bool git_path_isdir(const char *path); extern bool git_path_isfile(const char *path); /** + * Check if the given path is a directory, and is empty. + */ +extern bool git_path_is_empty_dir(const char *path); + +/** * Stat a file and/or link and set error if needed. */ extern int git_path_lstat(const char *path, struct stat *st); |