summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-04-08 12:42:18 -0700
committerVicent Marti <tanoku@gmail.com>2011-04-08 12:42:18 -0700
commit41233c40c0e9cb8556a8ba131aa97a0ffbe46cb1 (patch)
tree4cc53045010f488f675b9a2bb99b6f55f7893231 /include/git2
parentcef75d743006401121cfe9a9da63933cfc7ecec1 (diff)
downloadlibgit2-41233c40c0e9cb8556a8ba131aa97a0ffbe46cb1.tar.gz
Add new method `git_repository_is_empty`
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/repository.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/git2/repository.h b/include/git2/repository.h
index 00c1f20d0..200f350b7 100644
--- a/include/git2/repository.h
+++ b/include/git2/repository.h
@@ -182,6 +182,18 @@ 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);
+
/** @} */
GIT_END_DECL
#endif