Merge branch 'sn/reset-doc-typofix'
[gitweb.git] / dir.c
diff --git a/dir.c b/dir.c
index 17590638176f26e35f3a728e5cd56917e0568541..5f1afb56bc6e6d5dc5300380f980f4b2699ab08d 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -52,6 +52,15 @@ static enum path_treatment read_directory_recursive(struct dir_struct *dir,
 static int get_dtype(struct dirent *de, struct index_state *istate,
                     const char *path, int len);
 
+int count_slashes(const char *s)
+{
+       int cnt = 0;
+       while (*s)
+               if (*s++ == '/')
+                       cnt++;
+       return cnt;
+}
+
 int fspathcmp(const char *a, const char *b)
 {
        return ignore_case ? strcasecmp(a, b) : strcmp(a, b);