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
6782245e
Commit
6782245e
authored
Jul 21, 2012
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repo: add git_repository_wrap_odb() to wrap an ODB
Primarily useful when used together with git_odb_backend_one_pack().
parent
507523c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
include/git2/repository.h
+13
-0
src/repository.c
+13
-0
No files found.
include/git2/repository.h
View file @
6782245e
...
...
@@ -36,6 +36,19 @@ GIT_BEGIN_DECL
GIT_EXTERN
(
int
)
git_repository_open
(
git_repository
**
repository
,
const
char
*
path
);
/**
* Create a "fake" repository to wrap an object database
*
* Create a repository object to wrap an object database to be used
* with the API when all you have is an object database. This doesn't
* have any paths associated with it, so use with care.
*
* @param repository pointer to the repo
* @param odb the object database to wrap
* @return 0 or an error code
*/
GIT_EXTERN
(
int
)
git_repository_wrap_odb
(
git_repository
**
repository
,
git_odb
*
odb
);
/**
* Look for a git repository and copy its path in the given buffer.
* The lookup start from base_path and walk across parent directories
* if nothing has been found. The lookup ends when the first repository
...
...
src/repository.c
View file @
6782245e
...
...
@@ -388,6 +388,19 @@ int git_repository_open(git_repository **repo_out, const char *path)
repo_out
,
path
,
GIT_REPOSITORY_OPEN_NO_SEARCH
,
NULL
);
}
int
git_repository_wrap_odb
(
git_repository
**
repo_out
,
git_odb
*
odb
)
{
git_repository
*
repo
;
repo
=
repository_alloc
();
GITERR_CHECK_ALLOC
(
repo
);
git_repository_set_odb
(
repo
,
odb
);
*
repo_out
=
repo
;
return
0
;
}
int
git_repository_discover
(
char
*
repository_path
,
size_t
size
,
...
...
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