diff options
| author | Carlos Martín Nieto <cmn@elego.de> | 2011-04-11 17:41:21 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@elego.de> | 2011-04-11 17:43:56 +0200 |
| commit | 55c197cdd37b34c7b4877bc0434c297075e11222 (patch) | |
| tree | 05dcc126d117b1753e07f0a173cf9498a38ac4f9 /include/git2/repository.h | |
| parent | b075b9910c56c356d53439fd34486a905146211a (diff) | |
| parent | fdd0cc9e8948bb65c9a461c58e5094a3613bd975 (diff) | |
| download | libgit2-55c197cdd37b34c7b4877bc0434c297075e11222.tar.gz | |
Merge upstream/development
Diffstat (limited to 'include/git2/repository.h')
| -rw-r--r-- | include/git2/repository.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/git2/repository.h b/include/git2/repository.h index 00c1f20d0..c47fcfc9a 100644 --- a/include/git2/repository.h +++ b/include/git2/repository.h @@ -182,6 +182,36 @@ GIT_EXTERN(void) git_repository_free(git_repository *repo); */ GIT_EXTERN(int) git_repository_init(git_repository **repo_out, const char *path, unsigned is_bare); +/** + * Check if a repository is empty + * + * An empty repository has just been initialized and contains + * no commits. + * + * @param repo Repo to test + * @return 1 if the repository is empty, 0 if it isn't, error code + * if the repository is corrupted + */ +GIT_EXTERN(int) git_repository_is_empty(git_repository *repo); + +/** + * Get the normalized path to the git repository. + * + * @param repo a repository object + * @return absolute path to the git directory + */ +GIT_EXTERN(const char *) git_repository_path(git_repository *repo); + +/** + * Get the normalized path to the working directory of the repository. + * + * If the repository is bare, there is no working directory and NULL we be returned. + * + * @param repo a repository object + * @return NULL if the repository is bare; absolute path to the working directory otherwise. + */ +GIT_EXTERN(const char *) git_repository_workdir(git_repository *repo); + /** @} */ GIT_END_DECL #endif |
