diff options
| author | Vicent Marti <tanoku@gmail.com> | 2010-12-02 18:35:38 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2010-12-02 18:35:38 +0200 |
| commit | 691aa96817b9b4c6ad3a43b2d31d6e96a918a999 (patch) | |
| tree | cf57f915d04e38b9bb3a94cc2d35bbc5c6e915a8 /src/git | |
| parent | eec952351363354cad2e094a10d8545e4d2a996f (diff) | |
| download | libgit2-691aa96817b9b4c6ad3a43b2d31d6e96a918a999.tar.gz | |
Add 'git_repository_open2' to customize repo folders
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/git')
| -rw-r--r-- | src/git/repository.h | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/git/repository.h b/src/git/repository.h index 81eb1ea59..661034719 100644 --- a/src/git/repository.h +++ b/src/git/repository.h @@ -36,12 +36,45 @@ GIT_BEGIN_DECL * * @param repository pointer to the repo which will be opened * @param path the path to the repository - * @return the new repository handle; NULL on error + * @return 0 on sucess; error code otherwise */ GIT_EXTERN(int) git_repository_open(git_repository **repository, const char *path); /** + * Open a git repository by manually specifying all its paths + * + * @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 git_object_directory The full path to the ODB folder. + * the folder where all the loose and packed objects are stored + * Equivalent to $GIT_OBJECT_DIRECTORY. + * If NULL, "$GIT_DIR/objects/" is assumed. + * + * @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 sucess; error code otherwise + */ +GIT_EXTERN(int) git_repository_open2(git_repository **repository, + const char *git_dir, + const char *git_object_directory, + 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 |
