rev-list: disable object/refname ambiguity check with --stdin
[gitweb.git] / sha1_file.c
index 9ae98c852c862679a064af34aa4d43141db7cc0c..760dd60031bc4de7f0155303da5938c1571a2378 100644 (file)
@@ -2860,7 +2860,9 @@ static int create_tmpfile(char *buffer, size_t bufsiz, const char *filename)
                /* Make sure the directory exists */
                memcpy(buffer, filename, dirlen);
                buffer[dirlen-1] = 0;
-               if (mkdir(buffer, 0777) || adjust_shared_perm(buffer))
+               if (mkdir(buffer, 0777) && errno != EEXIST)
+                       return -1;
+               if (adjust_shared_perm(buffer))
                        return -1;
 
                /* Try again */