mirror of
https://github.com/git/git.git
synced 2026-01-10 10:13:33 +00:00
Merge branch 'en/fetch-negotiation-default-fix'
Interaction between fetch.negotiationAlgorithm and feature.experimental configuration variables has been corrected. * en/fetch-negotiation-default-fix: repo-settings: rename the traditional default fetch.negotiationAlgorithm repo-settings: fix error handling for unknown values repo-settings: fix checking for fetch.negotiationAlgorithm=default
This commit is contained in:
@@ -927,7 +927,8 @@ test_expect_success 'fetching deepen' '
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'use ref advertisement to prune "have" lines sent' '
|
||||
test_negotiation_algorithm_default () {
|
||||
test_when_finished rm -rf clientv0 clientv2 &&
|
||||
rm -rf server client &&
|
||||
git init server &&
|
||||
test_commit -C server both_have_1 &&
|
||||
@@ -946,7 +947,7 @@ test_expect_success 'use ref advertisement to prune "have" lines sent' '
|
||||
rm -f trace &&
|
||||
cp -r client clientv0 &&
|
||||
GIT_TRACE_PACKET="$(pwd)/trace" git -C clientv0 \
|
||||
fetch origin server_has both_have_2 &&
|
||||
"$@" fetch origin server_has both_have_2 &&
|
||||
grep "have $(git -C client rev-parse client_has)" trace &&
|
||||
grep "have $(git -C client rev-parse both_have_2)" trace &&
|
||||
! grep "have $(git -C client rev-parse both_have_2^)" trace &&
|
||||
@@ -954,10 +955,27 @@ test_expect_success 'use ref advertisement to prune "have" lines sent' '
|
||||
rm -f trace &&
|
||||
cp -r client clientv2 &&
|
||||
GIT_TRACE_PACKET="$(pwd)/trace" git -C clientv2 -c protocol.version=2 \
|
||||
fetch origin server_has both_have_2 &&
|
||||
"$@" fetch origin server_has both_have_2 &&
|
||||
grep "have $(git -C client rev-parse client_has)" trace &&
|
||||
grep "have $(git -C client rev-parse both_have_2)" trace &&
|
||||
! grep "have $(git -C client rev-parse both_have_2^)" trace
|
||||
}
|
||||
|
||||
test_expect_success 'use ref advertisement to prune "have" lines sent' '
|
||||
test_negotiation_algorithm_default
|
||||
'
|
||||
|
||||
test_expect_success 'same as last but with config overrides' '
|
||||
test_negotiation_algorithm_default \
|
||||
-c feature.experimental=true \
|
||||
-c fetch.negotiationAlgorithm=consecutive
|
||||
'
|
||||
|
||||
test_expect_success 'ensure bogus fetch.negotiationAlgorithm yields error' '
|
||||
test_when_finished rm -rf clientv0 &&
|
||||
cp -r client clientv0 &&
|
||||
test_must_fail git -C clientv0 --fetch.negotiationAlgorithm=bogus \
|
||||
fetch origin server_has both_have_2
|
||||
'
|
||||
|
||||
test_expect_success 'filtering by size' '
|
||||
|
||||
Reference in New Issue
Block a user