Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
af12fc11
Unverified
Commit
af12fc11
authored
Mar 02, 2023
by
Edward Thomson
Committed by
GitHub
Mar 02, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6520 from libgit2/ethomson/git_odb_open
odb: restore `git_odb_open`
parents
7445d510
e1e0d77c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
0 deletions
+53
-0
src/libgit2/odb.c
+19
-0
tests/libgit2/odb/open.c
+34
-0
No files found.
src/libgit2/odb.c
View file @
af12fc11
...
@@ -856,6 +856,25 @@ int git_odb__open(
...
@@ -856,6 +856,25 @@ int git_odb__open(
return
0
;
return
0
;
}
}
#ifdef GIT_EXPERIMENTAL_SHA256
int
git_odb_open
(
git_odb
**
out
,
const
char
*
objects_dir
,
const
git_odb_options
*
opts
)
{
return
git_odb__open
(
out
,
objects_dir
,
opts
);
}
#else
int
git_odb_open
(
git_odb
**
out
,
const
char
*
objects_dir
)
{
return
git_odb__open
(
out
,
objects_dir
,
NULL
);
}
#endif
int
git_odb__set_caps
(
git_odb
*
odb
,
int
caps
)
int
git_odb__set_caps
(
git_odb
*
odb
,
int
caps
)
{
{
if
(
caps
==
GIT_ODB_CAP_FROM_OWNER
)
{
if
(
caps
==
GIT_ODB_CAP_FROM_OWNER
)
{
...
...
tests/libgit2/odb/open.c
0 → 100644
View file @
af12fc11
#include "clar_libgit2.h"
void
test_odb_open__initialize
(
void
)
{
cl_fixture_sandbox
(
"testrepo.git"
);
}
void
test_odb_open__cleanup
(
void
)
{
cl_fixture_cleanup
(
"testrepo.git"
);
}
void
test_odb_open__exists
(
void
)
{
git_odb
*
odb
;
git_oid
one
,
two
;
#ifdef GIT_EXPERIMENTAL_SHA256
git_odb_options
opts
=
GIT_ODB_OPTIONS_INIT
;
cl_git_pass
(
git_odb_open
(
&
odb
,
"testrepo.git/objects"
,
&
opts
));
cl_git_pass
(
git_oid_fromstr
(
&
one
,
"1385f264afb75a56a5bec74243be9b367ba4ca08"
,
GIT_OID_SHA1
));
cl_git_pass
(
git_oid_fromstr
(
&
two
,
"00112233445566778899aabbccddeeff00112233"
,
GIT_OID_SHA1
));
#else
cl_git_pass
(
git_odb_open
(
&
odb
,
"testrepo.git/objects"
));
cl_git_pass
(
git_oid_fromstr
(
&
one
,
"1385f264afb75a56a5bec74243be9b367ba4ca08"
));
cl_git_pass
(
git_oid_fromstr
(
&
two
,
"00112233445566778899aabbccddeeff00112233"
));
#endif
cl_assert
(
git_odb_exists
(
odb
,
&
one
));
cl_assert
(
!
git_odb_exists
(
odb
,
&
two
));
git_odb_free
(
odb
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment