]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5512-ls-remote.sh
Merge branch 'jk/proto-v2-ref-prefix-fix'
[thirdparty/git.git] / t / t5512-ls-remote.sh
index bc5703ff9ba166b928199abf3085ff55a8fc09f1..91ee6841c150f5b7c03e2624231b5344a1fa47e9 100755 (executable)
@@ -302,4 +302,22 @@ test_expect_success 'ls-remote works outside repository' '
        nongit git ls-remote dst.git
 '
 
+test_expect_success 'ls-remote patterns work with all protocol versions' '
+       git for-each-ref --format="%(objectname)        %(refname)" \
+               refs/heads/master refs/remotes/origin/master >expect &&
+       git -c protocol.version=1 ls-remote . master >actual.v1 &&
+       test_cmp expect actual.v1 &&
+       git -c protocol.version=2 ls-remote . master >actual.v2 &&
+       test_cmp expect actual.v2
+'
+
+test_expect_success 'ls-remote prefixes work with all protocol versions' '
+       git for-each-ref --format="%(objectname)        %(refname)" \
+               refs/heads/ refs/tags/ >expect &&
+       git -c protocol.version=1 ls-remote --heads --tags . >actual.v1 &&
+       test_cmp expect actual.v1 &&
+       git -c protocol.version=2 ls-remote --heads --tags . >actual.v2 &&
+       test_cmp expect actual.v2
+'
+
 test_done