fetch: add --refetch option

Teach fetch and transports the --refetch option to force a full fetch
without negotiating common commits with the remote. Use when applying a
new partial clone filter to refetch all matching objects.

Signed-off-by: Robert Coup <robert@coup.net.nz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Robert Coup
2022-03-28 14:02:08 +00:00
committed by Junio C Hamano
parent 869a0eb4eb
commit 3c7bab06e1
5 changed files with 34 additions and 1 deletions

View File

@@ -715,6 +715,9 @@ static int fetch_refs(struct transport *transport,
if (data->transport_options.update_shallow)
set_helper_option(transport, "update-shallow", "true");
if (data->transport_options.refetch)
set_helper_option(transport, "refetch", "true");
if (data->transport_options.filter_options.choice) {
const char *spec = expand_list_objects_filter_spec(
&data->transport_options.filter_options);