diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-12-19 02:15:17 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-12-19 02:15:17 +0300 |
commit | 772bdcd4296b259d52aafb0badd79872e9db3bb3 (patch) | |
tree | dac15d162ac6aae28d0e3cfdd287d66767621c21 /remote.c | |
parent | f4d8e191230b3d233005720085092b97e9bf32f1 (diff) | |
parent | 675704c74dd4476f455bfa91e72eb9e163317c10 (diff) |
Merge branch 'js/init-defaultbranch-advice'
Our users are going to be trained to prepare for future change of
init.defaultBranch configuration variable.
* js/init-defaultbranch-advice:
init: provide useful advice about init.defaultBranch
get_default_branch_name(): prepare for showing some advice
branch -m: allow renaming a yet-unborn branch
init: document `init.defaultBranch` better
Diffstat (limited to 'remote.c')
-rw-r--r-- | remote.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -284,7 +284,7 @@ static void read_branches_file(struct remote *remote) if (frag) *(frag++) = '\0'; else - frag = (char *)git_default_branch_name(); + frag = (char *)git_default_branch_name(0); add_url_alias(remote, strbuf_detach(&buf, NULL)); refspec_appendf(&remote->fetch, "refs/heads/%s:refs/heads/%s", @@ -2206,7 +2206,8 @@ struct ref *guess_remote_head(const struct ref *head, /* If a remote branch exists with the default branch name, let's use it. */ if (!all) { - char *ref = xstrfmt("refs/heads/%s", git_default_branch_name()); + char *ref = xstrfmt("refs/heads/%s", + git_default_branch_name(0)); r = find_ref_by_name(refs, ref); free(ref); |