summaryrefslogtreecommitdiff
path: root/fetch-negotiator.c
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2020-08-18 04:01:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-08-18 20:25:05 (GMT)
commitcbe566a0710b39691ca8f6cb6a764f6c553cd97b (patch)
tree19e21e913737a6ad6d6c0137411b05d7bf5c8bd8 /fetch-negotiator.c
parent887952b8c680626f4721cb5fa57704478801aca4 (diff)
downloadgit-cbe566a0710b39691ca8f6cb6a764f6c553cd97b.zip
git-cbe566a0710b39691ca8f6cb6a764f6c553cd97b.tar.gz
git-cbe566a0710b39691ca8f6cb6a764f6c553cd97b.tar.bz2
negotiator/noop: add noop fetch negotiator
Add a noop fetch negotiator. This is introduced to allow partial clones to skip the unneeded negotiation step when fetching missing objects using a "git fetch" subprocess. (The implementation of spawning a "git fetch" subprocess will be done in a subsequent patch.) But this can also be useful for end users, e.g. as a blunt fix for object corruption. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fetch-negotiator.c')
-rw-r--r--fetch-negotiator.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fetch-negotiator.c b/fetch-negotiator.c
index 0a1357d..57ed578 100644
--- a/fetch-negotiator.c
+++ b/fetch-negotiator.c
@@ -2,6 +2,7 @@
#include "fetch-negotiator.h"
#include "negotiator/default.h"
#include "negotiator/skipping.h"
+#include "negotiator/noop.h"
#include "repository.h"
void fetch_negotiator_init(struct repository *r,
@@ -13,6 +14,10 @@ void fetch_negotiator_init(struct repository *r,
skipping_negotiator_init(negotiator);
return;
+ case FETCH_NEGOTIATION_NOOP:
+ noop_negotiator_init(negotiator);
+ return;
+
case FETCH_NEGOTIATION_DEFAULT:
default:
default_negotiator_init(negotiator);