Merge branch 'jt/clone-guess-remote-head-fix'

"git clone" still gave the message about the default branch name;
this message has been turned into an advice message that can be
turned off.

* jt/clone-guess-remote-head-fix:
  advice: allow disabling default branch name advice
  builtin/clone: suppress unexpected default branch advice
  remote: allow `guess_remote_head()` to suppress advice
This commit is contained in:
Junio C Hamano
2025-04-15 13:50:16 -07:00
10 changed files with 44 additions and 13 deletions

3
refs.c
View File

@@ -664,7 +664,8 @@ char *repo_default_branch_name(struct repository *r, int quiet)
if (!ret) {
ret = xstrdup("master");
if (!quiet)
advise(_(default_branch_name_advice), ret);
advise_if_enabled(ADVICE_DEFAULT_BRANCH_NAME,
_(default_branch_name_advice), ret);
}
full_ref = xstrfmt("refs/heads/%s", ret);