aboutsummaryrefslogtreecommitdiffstats
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-04-15 13:50:16 -0700
committerJunio C Hamano <gitster@pobox.com>2025-04-15 13:50:16 -0700
commita8c207797f2fe624c4959487e3508dde96f68976 (patch)
tree6933bb5b61b08cc9adf218024a19a4651f6fd525 /builtin
parentMerge branch 'ds/maintenance-loose-objects-batchsize' (diff)
parentadvice: allow disabling default branch name advice (diff)
downloadgit-a8c207797f2fe624c4959487e3508dde96f68976.tar.gz
git-a8c207797f2fe624c4959487e3508dde96f68976.zip
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
Diffstat (limited to 'builtin')
-rw-r--r--builtin/clone.c7
-rw-r--r--builtin/fetch.c2
-rw-r--r--builtin/remote.c2
3 files changed, 7 insertions, 4 deletions
diff --git a/builtin/clone.c b/builtin/clone.c
index 2993acb630..7d5b64a6a0 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -452,7 +452,9 @@ static struct ref *wanted_peer_refs(struct clone_opts *opts,
if (head)
tail_link_ref(head, &tail);
if (option_single_branch)
- refs = to_free = guess_remote_head(head, refs, 0);
+ refs = to_free =
+ guess_remote_head(head, refs,
+ REMOTE_GUESS_HEAD_QUIET);
} else if (option_single_branch) {
local_refs = NULL;
tail = &local_refs;
@@ -1525,7 +1527,8 @@ int cmd_clone(int argc,
}
remote_head = find_ref_by_name(refs, "HEAD");
- remote_head_points_at = guess_remote_head(remote_head, mapped_refs, 0);
+ remote_head_points_at = guess_remote_head(remote_head, mapped_refs,
+ REMOTE_GUESS_HEAD_QUIET);
if (option_branch) {
our_head_points_at = find_remote_branch(mapped_refs, option_branch);
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 9830c09011..1c6573345e 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -1638,7 +1638,7 @@ static int set_head(const struct ref *remote_refs, struct remote *remote)
get_fetch_map(remote_refs, &refspec, &fetch_map_tail, 0);
matches = guess_remote_head(find_ref_by_name(remote_refs, "HEAD"),
- fetch_map, 1);
+ fetch_map, REMOTE_GUESS_HEAD_ALL);
for (ref = matches; ref; ref = ref->next) {
string_list_append(&heads, strip_refshead(ref->name));
}
diff --git a/builtin/remote.c b/builtin/remote.c
index 1b7aad8838..d2aeb5ba1f 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -511,7 +511,7 @@ static int get_head_names(const struct ref *remote_refs, struct ref_states *stat
get_fetch_map(remote_refs, &refspec, &fetch_map_tail, 0);
matches = guess_remote_head(find_ref_by_name(remote_refs, "HEAD"),
- fetch_map, 1);
+ fetch_map, REMOTE_GUESS_HEAD_ALL);
for (ref = matches; ref; ref = ref->next)
string_list_append(&states->heads, abbrev_branch(ref->name));