]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5500-fetch-pack.sh
fetch-pack: in protocol v2, in_vain only after ACK
[thirdparty/git.git] / t / t5500-fetch-pack.sh
index 6b97923964ef990a8112e753d138af386275eccb..95ed08db1b8a71044082fa5e99c96989be6c457f 100755 (executable)
@@ -385,6 +385,24 @@ test_expect_success 'clone shallow with packed refs' '
        test_cmp count8.expected count8.actual
 '
 
+test_expect_success 'in_vain not triggered before first ACK' '
+       rm -rf myserver myclient trace &&
+       git init myserver &&
+       test_commit -C myserver foo &&
+       git clone "file://$(pwd)/myserver" myclient &&
+
+       # MAX_IN_VAIN is 256. Because of batching, the client will send 496
+       # (16+32+64+128+256) commits, not 256, before giving up. So create 496
+       # irrelevant commits.
+       test_commit_bulk -C myclient 496 &&
+
+       # The new commit that the client wants to fetch.
+       test_commit -C myserver bar &&
+
+       GIT_TRACE_PACKET="$(pwd)/trace" git -C myclient fetch --progress origin &&
+       test_i18ngrep "Total 3 " trace
+'
+
 test_expect_success 'fetch in shallow repo unreachable shallow objects' '
        (
                git clone --bare --branch B --single-branch "file://$(pwd)/." no-reflog &&