]> git.ipfire.org Git - thirdparty/git.git/blobdiff - dir.h
add is_dot_or_dotdot inline function
[thirdparty/git.git] / dir.h
diff --git a/dir.h b/dir.h
index 768425af0e7095a54edf161fe20400c4caf85b31..02875ec58b2642c619ac4e7a88a6f3a50b1e7f85 100644 (file)
--- a/dir.h
+++ b/dir.h
@@ -77,6 +77,13 @@ 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 void setup_standard_excludes(struct dir_struct *dir);
 extern int remove_dir_recursively(struct strbuf *path, int only_empty);