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:
authorJonathan Tan <jonathantanmy@google.com>2020-08-18 07:01:31 +0300
committerJunio C Hamano <gitster@pobox.com>2020-08-18 23:25:05 +0300
commitcbe566a0710b39691ca8f6cb6a764f6c553cd97b (patch)
tree19e21e913737a6ad6d6c0137411b05d7bf5c8bd8 /t/t5554-noop-fetch-negotiator.sh
parent887952b8c680626f4721cb5fa57704478801aca4 (diff)
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 't/t5554-noop-fetch-negotiator.sh')
-rwxr-xr-xt/t5554-noop-fetch-negotiator.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t5554-noop-fetch-negotiator.sh b/t/t5554-noop-fetch-negotiator.sh
new file mode 100755
index 0000000000..2ac7b5859e
--- /dev/null
+++ b/t/t5554-noop-fetch-negotiator.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+test_description='test noop fetch negotiator'
+. ./test-lib.sh
+
+test_expect_success 'noop negotiator does not emit any "have"' '
+ rm -f trace &&
+
+ test_create_repo server &&
+ test_commit -C server to_fetch &&
+
+ test_create_repo client &&
+ test_commit -C client we_have &&
+
+ test_config -C client fetch.negotiationalgorithm noop &&
+ GIT_TRACE_PACKET="$(pwd)/trace" git -C client fetch "$(pwd)/server" &&
+
+ ! grep "fetch> have" trace &&
+ grep "fetch> done" trace
+'
+
+test_done