summaryrefslogtreecommitdiff
path: root/src/libgit2/odb_loose.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libgit2/odb_loose.c')
-rw-r--r--src/libgit2/odb_loose.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/libgit2/odb_loose.c b/src/libgit2/odb_loose.c
index d1abbe233..51195d357 100644
--- a/src/libgit2/odb_loose.c
+++ b/src/libgit2/odb_loose.c
@@ -1204,3 +1204,37 @@ int git_odb__backend_loose(
*backend_out = (git_odb_backend *)backend;
return 0;
}
+
+
+#ifdef GIT_EXPERIMENTAL_SHA256
+int git_odb_backend_loose(
+ git_odb_backend **backend_out,
+ const char *objects_dir,
+ git_odb_backend_loose_options *opts)
+{
+ return git_odb__backend_loose(backend_out, objects_dir, opts);
+}
+#else
+int git_odb_backend_loose(
+ git_odb_backend **backend_out,
+ const char *objects_dir,
+ int compression_level,
+ int do_fsync,
+ unsigned int dir_mode,
+ unsigned int file_mode)
+{
+ git_odb_backend_loose_flag_t flags = 0;
+ git_odb_backend_loose_options opts = GIT_ODB_BACKEND_LOOSE_OPTIONS_INIT;
+
+ if (do_fsync)
+ flags |= GIT_ODB_BACKEND_LOOSE_FSYNC;
+
+ opts.flags = flags;
+ opts.compression_level = compression_level;
+ opts.dir_mode = dir_mode;
+ opts.file_mode = file_mode;
+ opts.oid_type = GIT_OID_DEFAULT;
+
+ return git_odb__backend_loose(backend_out, objects_dir, &opts);
+}
+#endif