Remove empty ref directories that prevent creating a ref.
[gitweb.git] / dir.c
diff --git a/dir.c b/dir.c
index 5a40d8ff8c99c80bf8f0484425db6022c6f7d8e9..e2f472ba7f5d3e5146f110dd3eaae9e5494854e2 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -397,3 +397,10 @@ int read_directory(struct dir_struct *dir, const char *path, const char *base, i
        qsort(dir->entries, dir->nr, sizeof(struct dir_entry *), cmp_name);
        return dir->nr;
 }
+
+int
+file_exists(const char *f)
+{
+  struct stat sb;
+  return stat(f, &sb) == 0;
+}