Commit f0b2bfe52743e98e241405008744d39f12e521b3

nulltoken 2010-12-17T14:24:47

Made gitfo_mkdir_recurs() more tolerant. Doesn't err any more when the directory already exists.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/src/fileops.c b/src/fileops.c
index 9fe017c..8cdfb03 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -313,5 +313,12 @@ int gitfo_dirent(
 
 int gitfo_mkdir_recurs(const char *path, int mode)
 {
-	return gitfo_mkdir(path, mode);
+	int error;
+
+	error = gitfo_mkdir(path, mode);
+
+	if (errno == EEXIST)
+		return GIT_SUCCESS;
+
+	return error;
 }
\ No newline at end of file