diff options
| author | Justin Tobler <jltobler@gmail.com> | 2025-03-24 19:51:46 -0500 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-03-25 16:09:27 -0700 |
| commit | d5d284df910b5f03681b480ae061bb1435b3b4b2 (patch) | |
| tree | 44349ee09df44c6039fd7afeedadada8b8f6d316 /builtin/fetch.c | |
| parent | Git 2.49 (diff) | |
| download | git-d5d284df910b5f03681b480ae061bb1435b3b4b2.tar.gz git-d5d284df910b5f03681b480ae061bb1435b3b4b2.zip | |
remote: allow `guess_remote_head()` to suppress advice
The `repo_default_branch_name()` invoked through `guess_remote_head()`
is configured to always display the default branch advice message.
Adapt `guess_remote_head()` to accept flags and convert the `all`
parameter to a flag. Add the `REMOTE_GUESS_HEAD_QUIET` flag to to enable
suppression of advice messages. Call sites are updated accordingly.
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 'builtin/fetch.c')
| -rw-r--r-- | builtin/fetch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c index 95fd0018b9..763314bfcb 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)); } |
