]> git.proxmox.com Git - libgit2.git/blobdiff - src/odb_loose.c
fileops/repository: create (most) directories with 0777 permissions
[libgit2.git] / src / odb_loose.c
index 80f0aa9e79cad2b03a1b47b6c8bc8abc82f9d301..a3013d3ddac684534e1ac01b601bd2bcb1173902 100644 (file)
@@ -666,7 +666,7 @@ static int loose_backend__stream_fwrite(git_oid *oid, git_odb_stream *_stream)
        if (object_file_name(final_path, sizeof(final_path), backend->objects_dir, oid))
                return GIT_ENOMEM;
 
-       if ((error = git_futils_mkpath2file(final_path)) < GIT_SUCCESS)
+       if ((error = git_futils_mkpath2file(final_path, GIT_OBJECT_DIR_MODE)) < GIT_SUCCESS)
                return git__rethrow(error, "Failed to write loose backend");
 
        stream->finished = 1;
@@ -787,7 +787,7 @@ static int loose_backend__write(git_oid *oid, git_odb_backend *_backend, const v
        if ((error = object_file_name(final_path, sizeof(final_path), backend->objects_dir, oid)) < GIT_SUCCESS)
                goto cleanup;
 
-       if ((error = git_futils_mkpath2file(final_path)) < GIT_SUCCESS)
+       if ((error = git_futils_mkpath2file(final_path, GIT_OBJECT_DIR_MODE)) < GIT_SUCCESS)
                goto cleanup;
 
        return git_filebuf_commit_at(&fbuf, final_path);