diff options
author | Vicent Marti <tanoku@gmail.com> | 2010-12-19 21:30:15 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2010-12-19 21:30:15 +0200 |
commit | fe93dabeef1f2757e73757bb2ec2dd3c912325a8 (patch) | |
tree | 47fb3f8009e59238bc6044a04fa9f9485bdf21af /src/git2 | |
parent | 8ea7fbc0cd5bdee858cfbb239fa043f075a3cc5f (diff) | |
parent | 1c2c7c0d1663bcdd279a0a73f6673ab5f81f7ec5 (diff) | |
download | libgit2-fe93dabeef1f2757e73757bb2ec2dd3c912325a8.tar.gz |
Merge branch 'repo-init' of https://github.com/nulltoken/libgit2 into nulltoken-repo-init
Diffstat (limited to 'src/git2')
-rw-r--r-- | src/git2/repository.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/git2/repository.h b/src/git2/repository.h index 24b411b64..4c7ba8ded 100644 --- a/src/git2/repository.h +++ b/src/git2/repository.h @@ -59,7 +59,7 @@ GIT_BEGIN_DECL * * @param repository pointer to the repo which will be opened * @param path the path to the repository - * @return 0 on sucess; error code otherwise + * @return 0 on success; error code otherwise */ GIT_EXTERN(int) git_repository_open(git_repository **repository, const char *path); @@ -88,7 +88,7 @@ GIT_EXTERN(int) git_repository_open(git_repository **repository, const char *pat * Equivalent to $GIT_WORK_TREE. * If NULL, the repository is assumed to be bare. * - * @return 0 on sucess; error code otherwise + * @return 0 on success; error code otherwise */ GIT_EXTERN(int) git_repository_open2(git_repository **repository, const char *git_dir, @@ -162,6 +162,22 @@ GIT_EXTERN(int) git_repository_newobject(git_object **object, git_repository *re */ GIT_EXTERN(void) git_repository_free(git_repository *repo); +/** + * Creates a new Git repository. + * + * Limits: + * - Reinit of an existing directory is not implemented yet. Will blindly return GIT_SUCCESS. + * - The parent directory structure of the repository has to already exist. Recursive building of the parent tree structure is not implemented yet. + * - Config file creation handling is not implemented yet. + * + * @param repo_out pointer to the repo which will be created or reinitialized + * @param path the path to the repository + * @param is_bare if true, a Git repository without a working directory is created at the pointed path. + * If false, provided path will be considered as the working directory into which the .git directory will be created. + * @return 0 on success; error code otherwise + */ +GIT_EXTERN(int) git_repository_init(git_repository** repo_out, const char* path, unsigned is_bare); + /** @} */ GIT_END_DECL #endif |