Merge branch 'jk/autocrlf-overrides-eol-doc'
[gitweb.git] / t / t5500-fetch-pack.sh
index 1b5a4a6d380f37b0e616e5ca6c5fd5b732e6383d..49c540b1e1dbd5fc7d9a7baa36ee93a2ed3fc3c3 100755 (executable)
@@ -50,8 +50,11 @@ pull_to_client () {
                        case "$heads" in *B*)
                            git update-ref refs/heads/B "$BTIP";;
                        esac &&
-                       git symbolic-ref HEAD refs/heads/$(echo $heads \
-                               | sed -e "s/^\(.\).*$/\1/") &&
+
+                       git symbolic-ref HEAD refs/heads/$(
+                               echo $heads |
+                               sed -e "s/^\(.\).*$/\1/"
+                       ) &&
 
                        git fsck --full &&
 
@@ -436,15 +439,23 @@ test_expect_success 'setup tests for the --stdin parameter' '
        ) >input.dup
 '
 
-test_expect_success 'fetch refs from cmdline' '
-       (
-               cd client &&
-               git fetch-pack --no-progress .. $(cat ../input)
-       ) >output &&
-       cut -d " " -f 2 <output | sort >actual &&
-       test_cmp expect actual
+test_expect_success 'setup fetch refs from cmdline v[12]' '
+       cp -r client client1 &&
+       cp -r client client2
 '
 
+for version in '' 1 2
+do
+       test_expect_success "protocol.version=$version fetch refs from cmdline" "
+               (
+                       cd client$version &&
+                       GIT_TEST_PROTOCOL_VERSION=$version git fetch-pack --no-progress .. \$(cat ../input)
+               ) >output &&
+               cut -d ' ' -f 2 <output | sort >actual &&
+               test_cmp expect actual
+       "
+done
+
 test_expect_success 'fetch refs from stdin' '
        (
                cd client &&