Commit c4523c6c by Edward Thomson

odb: add back git_odb_backend_loose

`git_odb_backend_loose` was erroneously removed during a refactoring;
add it back.
parent 44d3372e
...@@ -1204,3 +1204,37 @@ int git_odb__backend_loose( ...@@ -1204,3 +1204,37 @@ int git_odb__backend_loose(
*backend_out = (git_odb_backend *)backend; *backend_out = (git_odb_backend *)backend;
return 0; 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment