aboutsummaryrefslogtreecommitdiffstats
path: root/dir.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-01-17 23:05:54 -0800
committerJunio C Hamano <gitster@pobox.com>2009-01-17 23:05:54 -0800
commit6af384ce73ad880253be5be7587f19f6fe3afcba (patch)
treec63418b88b19af0eb7ca37adfffa49408e57bc79 /dir.h
parentMerge branch 'jc/maint-format-patch' (diff)
parentAllow cloning to an existing empty directory (diff)
downloadgit-6af384ce73ad880253be5be7587f19f6fe3afcba.tar.gz
git-6af384ce73ad880253be5be7587f19f6fe3afcba.zip
Merge branch 'ap/clone-into-empty'
* ap/clone-into-empty: Allow cloning to an existing empty directory add is_dot_or_dotdot inline function
Diffstat (limited to 'dir.h')
-rw-r--r--dir.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/dir.h b/dir.h
index 768425af0e..bdc2d47447 100644
--- a/dir.h
+++ b/dir.h
@@ -77,6 +77,15 @@ extern int file_exists(const char *);
extern char *get_relative_cwd(char *buffer, int size, const char *dir);
extern int is_inside_dir(const char *dir);
+static inline int is_dot_or_dotdot(const char *name)
+{
+ return (name[0] == '.' &&
+ (name[1] == '\0' ||
+ (name[1] == '.' && name[2] == '\0')));
+}
+
+extern int is_empty_dir(const char *dir);
+
extern void setup_standard_excludes(struct dir_struct *dir);
extern int remove_dir_recursively(struct strbuf *path, int only_empty);