summaryrefslogtreecommitdiff
path: root/transport-helper.c
diff options
context:
space:
mode:
authorRobert Coup <robert@coup.net.nz>2022-03-28 14:02:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-03-28 17:25:52 (GMT)
commit3c7bab06e12922fbcb375187eb60ac426fc72a3a (patch)
treee1ebe117e15be200ddd71cafdb2bff01ad64a25a /transport-helper.c
parent869a0eb4ebddad9ea758464526524ed06f5a13a9 (diff)
downloadgit-3c7bab06e12922fbcb375187eb60ac426fc72a3a.zip
git-3c7bab06e12922fbcb375187eb60ac426fc72a3a.tar.gz
git-3c7bab06e12922fbcb375187eb60ac426fc72a3a.tar.bz2
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-helper.c')
-rw-r--r--transport-helper.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/transport-helper.c b/transport-helper.c
index a0297b0..b4dbbab 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -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);