summaryrefslogtreecommitdiff
path: root/src/git2
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-01-13 04:54:14 +0200
committerVicent Marti <tanoku@gmail.com>2011-01-13 04:54:14 +0200
commitec3c7a16c260fa6540cfe8daf37c1324100f51bf (patch)
treec95f8c1b0ab40fee42efbfd2e441901de0b95eb2 /src/git2
parentc5846fbf24f5c88704b2faa2a0905515936c874b (diff)
downloadlibgit2-ec3c7a16c260fa6540cfe8daf37c1324100f51bf.tar.gz
Add new Repository initialization method
Lets the user specify the ODB that will be used by the repository manually. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/git2')
-rw-r--r--src/git2/repository.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/git2/repository.h b/src/git2/repository.h
index 4eaa6f2ba..37a541f24 100644
--- a/src/git2/repository.h
+++ b/src/git2/repository.h
@@ -98,6 +98,42 @@ GIT_EXTERN(int) git_repository_open2(git_repository **repository,
/**
+ * Open a git repository by manually specifying its paths and
+ * the object database it will use.
+ *
+ * @param repository pointer to the repo which will be opened
+ *
+ * @param git_dir The full path to the repository folder
+ * e.g. a '.git' folder for live repos, any folder for bare
+ * Equivalent to $GIT_DIR.
+ * Cannot be NULL.
+ *
+ * @param object_database A pointer to a git_odb created & initialized
+ * by the user (e.g. with custom backends). This object database
+ * will be owned by the repository and will be automatically free'd.
+ * It should not be manually free'd by the user, or this
+ * git_repository object will become invalid.
+ *
+ * @param git_index_file The full path to the index (dircache) file
+ * Equivalent to $GIT_INDEX_FILE.
+ * If NULL, "$GIT_DIR/index" is assumed.
+ *
+ * @param git_work_tree The full path to the working tree of the repository,
+ * if the repository is not bare.
+ * Equivalent to $GIT_WORK_TREE.
+ * If NULL, the repository is assumed to be bare.
+ *
+ * @return 0 on success; error code otherwise
+ */
+
+GIT_EXTERN(int) git_repository_open3(git_repository **repository,
+ const char *git_dir,
+ git_odb *object_database,
+ const char *git_index_file,
+ const char *git_work_tree);
+
+
+/**
* Lookup a reference to one of the objects in the repostory.
*
* The generated reference is owned by the repository and