Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Coup <robert@coup.net.nz>2022-03-28 17:02:07 +0300
committerJunio C Hamano <gitster@pobox.com>2022-03-28 20:25:52 +0300
commit869a0eb4ebddad9ea758464526524ed06f5a13a9 (patch)
treed8a51013b45312e0b4b2d26c1c8a5fbd1d1e4469 /remote-curl.c
parent4dfd0925cbba78cc737e3af29faa5774bbc7b6a3 (diff)
builtin/fetch-pack: add --refetch option
Add a refetch option to fetch-pack to force a full fetch. 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 'remote-curl.c')
-rw-r--r--remote-curl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/remote-curl.c b/remote-curl.c
index 0dabef2dd7..fc75600d4c 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -43,6 +43,7 @@ struct options {
/* see documentation of corresponding flag in fetch-pack.h */
from_promisor : 1,
+ refetch : 1,
atomic : 1,
object_format : 1,
force_if_includes : 1;
@@ -198,6 +199,9 @@ static int set_option(const char *name, const char *value)
} else if (!strcmp(name, "from-promisor")) {
options.from_promisor = 1;
return 0;
+ } else if (!strcmp(name, "refetch")) {
+ options.refetch = 1;
+ return 0;
} else if (!strcmp(name, "filter")) {
options.filter = xstrdup(value);
return 0;
@@ -1182,6 +1186,8 @@ static int fetch_git(struct discovery *heads,
strvec_push(&args, "--deepen-relative");
if (options.from_promisor)
strvec_push(&args, "--from-promisor");
+ if (options.refetch)
+ strvec_push(&args, "--refetch");
if (options.filter)
strvec_pushf(&args, "--filter=%s", options.filter);
strvec_push(&args, url.buf);