fetch: merge fetching and consuming refs
commit1c7d1ab6f4a79e44406f304ec01b0a143dae9abb
authorPatrick Steinhardt <ps@pks.im>
Wed, 1 Sep 2021 13:10:02 +0000 (1 15:10 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Sep 2021 19:43:56 +0000 (1 12:43 -0700)
tree7450965a6f0a6de5c72430fb04f37d1504e8d567
parent284b2ce8fcb100e7194b9cca6d9b99bca7da39b6
fetch: merge fetching and consuming refs

The functions `fetch_refs()` and `consume_refs()` must always be called
together such that we first obtain all missing objects and then update
our local refs to match the remote refs. In a subsequent patch, we'll
further require that `fetch_refs()` must always be called before
`consume_refs()` such that it can correctly assert that we have all
objects after the fetch given that we're about to move the connectivity
check.

Make this requirement explicit by merging both functions into a single
`fetch_and_consume_refs()` function.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch.c