diff options
| author | Vicent Martà <vicent@github.com> | 2012-07-31 10:16:21 -0700 |
|---|---|---|
| committer | Vicent Martà <vicent@github.com> | 2012-07-31 10:16:21 -0700 |
| commit | bfb59164687408bcc61b9b75bb391770fae7d9c2 (patch) | |
| tree | f688fc7c41b7d9c16f7243753db2b5a27f04af90 /include/git2 | |
| parent | 577cd8aec1b112fc099035817cdb69ec79edc569 (diff) | |
| parent | 6782245e51af13427cce7eb4dd4d3a4f202c9150 (diff) | |
| download | libgit2-bfb59164687408bcc61b9b75bb391770fae7d9c2.tar.gz | |
Merge pull request #833 from carlosmn/odb-one
odb: allow creating an ODB backend from a packfile index
Diffstat (limited to 'include/git2')
| -rw-r--r-- | include/git2/odb_backend.h | 1 | ||||
| -rw-r--r-- | include/git2/repository.h | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/git2/odb_backend.h b/include/git2/odb_backend.h index 3f67202d..b93ef204 100644 --- a/include/git2/odb_backend.h +++ b/include/git2/odb_backend.h @@ -100,6 +100,7 @@ struct git_odb_stream { GIT_EXTERN(int) git_odb_backend_pack(git_odb_backend **backend_out, const char *objects_dir); GIT_EXTERN(int) git_odb_backend_loose(git_odb_backend **backend_out, const char *objects_dir, int compression_level, int do_fsync); +GIT_EXTERN(int) git_odb_backend_one_pack(git_odb_backend **backend_out, const char *index_file); GIT_END_DECL diff --git a/include/git2/repository.h b/include/git2/repository.h index ff81b75e..ef2f5413 100644 --- a/include/git2/repository.h +++ b/include/git2/repository.h @@ -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 |
