]> asedeno.scripts.mit.edu Git - git.git/blobdiff - sha1_file.c
clone: create intermediate directories of destination repo
[git.git] / sha1_file.c
index b858c1308fd10c7a20c420c8bbeb16f13cb920f6..b2db549d8a61e5ffc282f7259a5187b9d1fc5706 100644 (file)
@@ -116,6 +116,15 @@ int safe_create_leading_directories(char *path)
        return 0;
 }
 
+int safe_create_leading_directories_const(const char *path)
+{
+       /* path points to cache entries, so xstrdup before messing with it */
+       char *buf = xstrdup(path);
+       int result = safe_create_leading_directories(buf);
+       free(buf);
+       return result;
+}
+
 char *sha1_to_hex(const unsigned char *sha1)
 {
        static int bufno;