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>
This commit is contained in:
committed by
Junio C Hamano
parent
887952b8c6
commit
cbe566a071
@ -39,6 +39,8 @@ void prepare_repo_settings(struct repository *r)
|
||||
if (!repo_config_get_string(r, "fetch.negotiationalgorithm", &strval)) {
|
||||
if (!strcasecmp(strval, "skipping"))
|
||||
r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_SKIPPING;
|
||||
else if (!strcasecmp(strval, "noop"))
|
||||
r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_NOOP;
|
||||
else
|
||||
r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_DEFAULT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user