t5512: compensate for v0 only sending HEAD symrefs
Protocol v2 supports sending non-HEAD symrefs, but this is not true of protocol v0. Some tests expect protocol v0 behavior, so fix them to use protocol v0. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Tan committed
Feb 25, 2019 at 13:54 UTC
b2f73b70b28d1966ed887b57b2e648f66916d8aa
1 file changed
+13
-5
t/t5512-ls-remote.sh
+13
-5
@@ -223,7 +223,9 @@ test_expect_success 'ls-remote --symref' '
223
$(git rev-parse refs/tags/mark1.10) refs/tags/mark1.10
224
$(git rev-parse refs/tags/mark1.2) refs/tags/mark1.2
225
EOF
226
- git ls-remote --symref >actual &&
226
+ # Protocol v2 supports sending symrefs for refs other than HEAD, so use
227
+ # protocol v0 here.
228
+ GIT_TEST_PROTOCOL_VERSION= git ls-remote --symref >actual &&
229
test_cmp expect actual
230
'
231
@@ -232,7 +234,9 @@ test_expect_success 'ls-remote with filtered symref (refname)' '
234
ref: refs/heads/master HEAD
235
1bd44cb9d13204b0fe1958db0082f5028a16eb3a HEAD
236
EOF
235
- git ls-remote --symref . HEAD >actual &&
237
+ # Protocol v2 supports sending symrefs for refs other than HEAD, so use
238
+ # protocol v0 here.
239
+ GIT_TEST_PROTOCOL_VERSION= git ls-remote --symref . HEAD >actual &&
240
test_cmp expect actual
241
'
242
@@ -243,7 +247,9 @@ test_expect_failure 'ls-remote with filtered symref (--heads)' '
247
1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/foo
248
1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/master
249
EOF
246
- git ls-remote --symref --heads . >actual &&
250
+ # Protocol v2 supports sending symrefs for refs other than HEAD, so use
251
+ # protocol v0 here.
252
+ GIT_TEST_PROTOCOL_VERSION= git ls-remote --symref --heads . >actual &&
253
test_cmp expect actual
254
'
255
@@ -252,9 +258,11 @@ test_expect_success 'ls-remote --symref omits filtered-out matches' '
258
1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/foo
259
1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/master
260
EOF
255
- git ls-remote --symref --heads . >actual &&
261
+ # Protocol v2 supports sending symrefs for refs other than HEAD, so use
262
+ # protocol v0 here.
263
+ GIT_TEST_PROTOCOL_VERSION= git ls-remote --symref --heads . >actual &&
264
test_cmp expect actual &&
257
- git ls-remote --symref . "refs/heads/*" >actual &&
265
+ GIT_TEST_PROTOCOL_VERSION= git ls-remote --symref . "refs/heads/*" >actual &&
266
test_cmp expect actual
267
'
268