diff options
author | Don Goodman-Wilson <don@goodman-wilson.com> | 2020-06-24 16:46:33 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-06-24 18:14:21 +0200 |
commit | 8747ebb7cde9e90d20794c06e6806f75cd540142 (patch) | |
tree | 2dedd0e043802202071b7490c1ba1a97ac03ad88 /refs.h | |
parent | init: allow specifying the initial branch name for the new repository (diff) | |
download | git-8747ebb7cde9e90d20794c06e6806f75cd540142.tar.xz git-8747ebb7cde9e90d20794c06e6806f75cd540142.zip |
init: allow setting the default for the initial branch name via the config
We just introduced the command-line option
`--initial-branch=<branch-name>` to allow initializing a new repository
with a different initial branch than the hard-coded one.
To allow users to override the initial branch name more permanently
(i.e. without having to specify the name manually for each and every
`git init` invocation), let's introduce the `init.defaultBranch` config
setting.
Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Helped-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Don Goodman-Wilson <don@goodman-wilson.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
-rw-r--r-- | refs.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -155,6 +155,15 @@ int dwim_ref(const char *str, int len, struct object_id *oid, char **ref); int dwim_log(const char *str, int len, struct object_id *oid, char **ref); /* + * Retrieves the default branch name for newly-initialized repositories. + * + * The return value of `repo_default_branch_name()` is an allocated string. The + * return value of `git_default_branch_name()` is a singleton. + */ +const char *git_default_branch_name(void); +char *repo_default_branch_name(struct repository *r); + +/* * A ref_transaction represents a collection of reference updates that * should succeed or fail together. * |