]> git.99rst.org Git - git.git/commit
clone: support unusual remote ref configurations
authorJonathan Tan <redacted>
Mon, 24 Jan 2022 18:09:09 +0000 (10:09 -0800)
committerJunio C Hamano <redacted>
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/clone.c
t/t5700-protocol-v1.sh
git clone https://git.99rst.org/PROJECT