]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5512-ls-remote.sh
t5512: compensate for v0 only sending HEAD symrefs
[thirdparty/git.git] / t / t5512-ls-remote.sh
index ced15ae1224247355125fcbad7ad2184f9861cbe..e3c4a48c8536e46e0aa36b4d862b3876617335a4 100755 (executable)
@@ -223,7 +223,9 @@ test_expect_success 'ls-remote --symref' '
        $(git rev-parse refs/tags/mark1.10)     refs/tags/mark1.10
        $(git rev-parse refs/tags/mark1.2)      refs/tags/mark1.2
        EOF
-       git ls-remote --symref >actual &&
+       # Protocol v2 supports sending symrefs for refs other than HEAD, so use
+       # protocol v0 here.
+       GIT_TEST_PROTOCOL_VERSION= git ls-remote --symref >actual &&
        test_cmp expect actual
 '
 
@@ -232,7 +234,9 @@ test_expect_success 'ls-remote with filtered symref (refname)' '
        ref: refs/heads/master  HEAD
        1bd44cb9d13204b0fe1958db0082f5028a16eb3a        HEAD
        EOF
-       git ls-remote --symref . HEAD >actual &&
+       # Protocol v2 supports sending symrefs for refs other than HEAD, so use
+       # protocol v0 here.
+       GIT_TEST_PROTOCOL_VERSION= git ls-remote --symref . HEAD >actual &&
        test_cmp expect actual
 '
 
@@ -243,7 +247,9 @@ test_expect_failure 'ls-remote with filtered symref (--heads)' '
        1bd44cb9d13204b0fe1958db0082f5028a16eb3a        refs/heads/foo
        1bd44cb9d13204b0fe1958db0082f5028a16eb3a        refs/heads/master
        EOF
-       git ls-remote --symref --heads . >actual &&
+       # Protocol v2 supports sending symrefs for refs other than HEAD, so use
+       # protocol v0 here.
+       GIT_TEST_PROTOCOL_VERSION= git ls-remote --symref --heads . >actual &&
        test_cmp expect actual
 '
 
@@ -252,9 +258,11 @@ test_expect_success 'ls-remote --symref omits filtered-out matches' '
        1bd44cb9d13204b0fe1958db0082f5028a16eb3a        refs/heads/foo
        1bd44cb9d13204b0fe1958db0082f5028a16eb3a        refs/heads/master
        EOF
-       git ls-remote --symref --heads . >actual &&
+       # Protocol v2 supports sending symrefs for refs other than HEAD, so use
+       # protocol v0 here.
+       GIT_TEST_PROTOCOL_VERSION= git ls-remote --symref --heads . >actual &&
        test_cmp expect actual &&
-       git ls-remote --symref . "refs/heads/*" >actual &&
+       GIT_TEST_PROTOCOL_VERSION= git ls-remote --symref . "refs/heads/*" >actual &&
        test_cmp expect actual
 '