mirror of
https://github.com/libgit2/libgit2.git
synced 2026-01-25 02:56:17 +00:00
repo: specify odb options to odb_wrap
odb wrapping
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user