summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTim Rogers <me@timrogers.co.uk>2023-02-23 18:47:03 +0000
committerTim Rogers <me@timrogers.co.uk>2023-02-23 18:47:03 +0000
commit86b532de1548669c8922b2bd3af57b21ab460e74 (patch)
treeccda5ee9042a3f3176e6b32e5b2669e5aa1cf027 /include
parent6f2eedb7eb58f5af2e96cafeae7261c07c928d89 (diff)
downloadlibgit2-86b532de1548669c8922b2bd3af57b21ab460e74.tar.gz
Correct the definition of "empty" in the docs for `git_repository_is_empty`
This improves the documentation for `git_repository_is_empty` which currently does not accurately describe libgit2's definition of "empty". It says that HEAD must point to the "unborn master branch", when in fact, this is not the case if the repo's `init.defaultBranch` configuration is set. If it is set, it will check that HEAD points there. Only if it is not set does it fall back to `master`.
Diffstat (limited to 'include')
-rw-r--r--include/git2/repository.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/git2/repository.h b/include/git2/repository.h
index 04c240d24..560e70ab6 100644
--- a/include/git2/repository.h
+++ b/include/git2/repository.h
@@ -465,7 +465,9 @@ GIT_EXTERN(int) git_repository_head_unborn(git_repository *repo);
* Check if a repository is empty
*
* An empty repository has just been initialized and contains no references
- * apart from HEAD, which must be pointing to the unborn master branch.
+ * apart from HEAD, which must be pointing to the unborn master branch,
+ * or the branch specified for the repository in the `init.defaultBranch`
+ * configuration variable.
*
* @param repo Repo to test
* @return 1 if the repository is empty, 0 if it isn't, error code