summaryrefslogtreecommitdiff
path: root/src/repository.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-07-13 10:08:23 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2020-08-03 11:53:20 +0100
commit4cc3b2cb9aed4a5d2b4e2740ffc6bbd69f0634cc (patch)
treed63b8dcbb22a80a5ec85bbd7138f999a4fe0dc4c /src/repository.h
parente411aae3850c59b5c32b16e339c4ce8af284183a (diff)
downloadlibgit2-4cc3b2cb9aed4a5d2b4e2740ffc6bbd69f0634cc.tar.gz
repo: add git_repository_initialbranch
Provide a helper function to get the initial branch for a repository, respecting the `init.defaultBranch` configuration option, if set, and returning the "default default" (currently `master`) otherwise.
Diffstat (limited to 'src/repository.h')
-rw-r--r--src/repository.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/repository.h b/src/repository.h
index d73e77d70..de009ba5e 100644
--- a/src/repository.h
+++ b/src/repository.h
@@ -232,4 +232,10 @@ extern size_t git_repository__reserved_names_posix_len;
bool git_repository__reserved_names(
git_buf **out, size_t *outlen, git_repository *repo, bool include_ntfs);
+/*
+ * The default branch for the repository; the `init.defaultBranch`
+ * configuration option, if set, or `master` if it is not.
+ */
+int git_repository_initialbranch(git_buf *out, git_repository *repo);
+
#endif