git-p4: add failing test for "git-p4: respect excluded paths when detecting branches"
[gitweb.git] / t / t5552-skipping-fetch-negotiator.sh
index 0ad50dd839fe56d240df9a7fd210c05574e41860..30857b84a8d5b5fdec59f775ab97293a7da4f2df 100755 (executable)
@@ -46,7 +46,7 @@ test_expect_success 'commits with no parents are sent regardless of skip distanc
        test_commit -C server to_fetch &&
 
        git init client &&
-       for i in $(seq 7)
+       for i in $(test_seq 7)
        do
                test_commit -C client c$i
        done &&
@@ -60,13 +60,36 @@ test_expect_success 'commits with no parents are sent regardless of skip distanc
        have_not_sent c6 c4 c3
 '
 
+test_expect_success 'unknown fetch.negotiationAlgorithm values error out' '
+       rm -rf server client trace &&
+       git init server &&
+       test_commit -C server to_fetch &&
+
+       git init client &&
+       test_commit -C client on_client &&
+       git -C client checkout on_client &&
+
+       test_config -C client fetch.negotiationAlgorithm invalid &&
+       test_must_fail git -C client fetch "$(pwd)/server" 2>err &&
+       test_i18ngrep "unknown fetch negotiation algorithm" err &&
+
+       # Explicit "default" value
+       test_config -C client fetch.negotiationAlgorithm default &&
+       git -C client -c fetch.negotiationAlgorithm=default fetch "$(pwd)/server" &&
+
+       # Implementation detail: If there is nothing to fetch, we will not error out
+       test_config -C client fetch.negotiationAlgorithm invalid &&
+       git -C client fetch "$(pwd)/server" 2>err &&
+       test_i18ngrep ! "unknown fetch negotiation algorithm" err
+'
+
 test_expect_success 'when two skips collide, favor the larger one' '
        rm -rf server client trace &&
        git init server &&
        test_commit -C server to_fetch &&
 
        git init client &&
-       for i in $(seq 11)
+       for i in $(test_seq 11)
        do
                test_commit -C client c$i
        done &&
@@ -145,14 +168,14 @@ test_expect_success 'do not send "have" with ancestors of commits that server AC
        test_commit -C server to_fetch &&
 
        git init client &&
-       for i in $(seq 8)
+       for i in $(test_seq 8)
        do
                git -C client checkout --orphan b$i &&
                test_commit -C client b$i.c0
        done &&
-       for j in $(seq 19)
+       for j in $(test_seq 19)
        do
-               for i in $(seq 8)
+               for i in $(test_seq 8)
                do
                        git -C client checkout b$i &&
                        test_commit -C client b$i.c$j
@@ -182,7 +205,7 @@ test_expect_success 'do not send "have" with ancestors of commits that server AC
 
        # fetch-pack should thus not send any more commits in the b1 branch, but
        # should still send the others (in this test, just check b2).
-       for i in $(seq 0 8)
+       for i in $(test_seq 0 8)
        do
                have_not_sent b1.c$i
        done &&