]> git.ipfire.org Git - thirdparty/git.git/commit - t/t5700-protocol-v1.sh
clone: support unusual remote ref configurations
authorJonathan Tan <jonathantanmy@google.com>
Mon, 24 Jan 2022 18:09:09 +0000 (10:09 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 26 Jan 2022 19:12:19 +0000 (11:12 -0800)
commitdccea605b6c30262a6a44bde8d10b0a20c331d87
treeb1c222ce5c208fa720fa08c7d28b88adacdb918e
parente9d7761bb94f20acc98824275e317fa82436c25d
clone: support unusual remote ref configurations

When cloning a branchless and tagless but not refless remote using
protocol v0 or v1, Git calls transport_fetch_refs() with an empty ref
list. This makes the clone fail with the message "remote transport
reported error".

Git should have refrained from calling transport_fetch_refs(), just like
it does in the case that the remote is refless. Therefore, teach Git to
do this.

In protocol v2, this does not happen because the client passes
ref-prefix arguments that filter out non-branches and non-tags in the
ref advertisement, making the remote appear empty.

Note that this bug concerns logic in builtin/clone.c and only affects
cloning, not fetching.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/clone.c
t/t5700-protocol-v1.sh