diff options
| author | Justin Tobler <jltobler@gmail.com> | 2025-03-24 19:51:47 -0500 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-03-25 16:09:28 -0700 |
| commit | c039a46e99541042554c52bdad2fb10ac5a1e97d (patch) | |
| tree | 1a1f6771f6fd8c7475c7edc3adc9be75108bd303 /diff-no-index.c | |
| parent | d5d284df910b5f03681b480ae061bb1435b3b4b2 (diff) | |
builtin/clone: suppress unexpected default branch advice
In 199f44cb2ead (builtin/clone: allow remote helpers to detect repo,
2024-02-27), clones started partially initializing the refdb before
executing the remote helpers by creating a HEAD file and "refs/"
directory. This has resulted in some scenarios where git-clone(1) now
prints the default branch name advice message where it previously did
not.
A side-effect of the HEAD file already existing, is that computation of
the default branch name is handled later in execution. This matters
because prior to 97abaab5f6 (refs: drop `git_default_branch_name()`,
2024-05-17), the default branch value would be computed during its first
execution and cached. Subsequent invocations would simply return the
cached value. Since the next `git_default_branch_name()` call site,
which is invoked through `guess_remote_head()`, is not configured to
suppress the advice message, computing the default branch name results
in the advice message being printed.
Configure `guess_remote_head()` to suppress the advice message,
restoring the previous behavior.
Signed-off-by: Justin Tobler <jltobler@gmail.com>
Acked-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff-no-index.c')
0 files changed, 0 insertions, 0 deletions
