aboutsummaryrefslogtreecommitdiffstats
path: root/transport.c
diff options
context:
space:
mode:
authorRobert Coup <robert@coup.net.nz>2022-03-28 14:02:08 +0000
committerJunio C Hamano <gitster@pobox.com>2022-03-28 10:25:52 -0700
commit3c7bab06e12922fbcb375187eb60ac426fc72a3a (patch)
treee1ebe117e15be200ddd71cafdb2bff01ad64a25a /transport.c
parent869a0eb4ebddad9ea758464526524ed06f5a13a9 (diff)
downloadgit-3c7bab06e12922fbcb375187eb60ac426fc72a3a.tar.gz
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>
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/transport.c b/transport.c
index 253d6671b1..e2817b7a71 100644
--- a/transport.c
+++ b/transport.c
@@ -243,6 +243,9 @@ static int set_git_option(struct git_transport_options *opts,
list_objects_filter_die_if_populated(&opts->filter_options);
parse_list_objects_filter(&opts->filter_options, value);
return 0;
+ } else if (!strcmp(name, TRANS_OPT_REFETCH)) {
+ opts->refetch = !!value;
+ return 0;
} else if (!strcmp(name, TRANS_OPT_REJECT_SHALLOW)) {
opts->reject_shallow = !!value;
return 0;
@@ -377,6 +380,7 @@ static int fetch_refs_via_pack(struct transport *transport,
args.update_shallow = data->options.update_shallow;
args.from_promisor = data->options.from_promisor;
args.filter_options = data->options.filter_options;
+ args.refetch = data->options.refetch;
args.stateless_rpc = transport->stateless_rpc;
args.server_options = transport->server_options;
args.negotiation_tips = data->options.negotiation_tips;