Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Straub <bstraub@github.com>2012-07-11 21:40:53 +0400
committerBen Straub <bstraub@github.com>2012-07-11 21:40:53 +0400
commitd024419f165e81f59d919bd56d84abf8e9fb9f57 (patch)
tree93c6fe213a8249c8308a3ee607da6af769125d55 /src/path.h
parentc3b5099fe46e1191784cc1890cd35f167305f47a (diff)
Add git_path_is_empty_dir.
Diffstat (limited to 'src/path.h')
-rw-r--r--src/path.h9
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);