repo: specify odb options to odb_wrap

odb wrapping
This commit is contained in:
Edward Thomson
2024-12-16 17:11:42 +00:00
parent 9aa5faa38b
commit cefcabfcc1
2 changed files with 6 additions and 3 deletions

View File

@@ -10,6 +10,7 @@
#include "common.h"
#include "types.h"
#include "oid.h"
#include "odb.h"
#include "buffer.h"
#include "commit.h"
@@ -57,7 +58,7 @@ GIT_EXTERN(int) git_repository_open_from_worktree(git_repository **out, git_work
GIT_EXTERN(int) git_repository_wrap_odb(
git_repository **out,
git_odb *odb,
git_oid_t oid_type);
const git_odb_options *opts);
#else

View File

@@ -1228,6 +1228,8 @@ int git_repository__wrap_odb(
{
git_repository *repo;
GIT_ASSERT_ARG(git_oid_type_is_valid(oid_type));
repo = repository_alloc();
GIT_ERROR_CHECK_ALLOC(repo);
@@ -1243,9 +1245,9 @@ int git_repository__wrap_odb(
int git_repository_wrap_odb(
git_repository **out,
git_odb *odb,
git_oid_t oid_type)
const git_odb_options *opts)
{
return git_repository__wrap_odb(out, odb, oid_type);
return git_repository__wrap_odb(out, odb, opts ? opts->oid_type : GIT_OID_DEFAULT);
}
#else
int git_repository_wrap_odb(git_repository **out, git_odb *odb)