t7406: fix misleading "rev-parse --max-count=1 HEAD"
The test happened to use "rev-parse --max-count=1 HEAD" consistently to prepare the expected output and the actual output, so the comparison between them gave us a correct success/failure because both output had irrelevant "--max-count=1" in it. But that is not an excuse to keep it broken. Replace it a more meaningful construct "rev-parse --verify HEAD". Noticed by Daniel Graña while working on his submodule tests. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Jul 30, 2012 at 10:51 UTC
ad6a599c0a98441e3da0aaeb44bd39a167cb0693
1 file changed
+8
-8
t/t7406-submodule-update.sh
+8
-8
@@ -305,7 +305,7 @@ test_expect_success 'submodule update continues after checkout error' '
305
git submodule init &&
306
git commit -am "new_submodule" &&
307
(cd submodule2 &&
308
- git rev-parse --max-count=1 HEAD > ../expect
308
+ git rev-parse --verify HEAD >../expect
309
) &&
310
(cd submodule &&
311
test_commit "update_submodule" file
@@ -322,7 +322,7 @@ test_expect_success 'submodule update continues after checkout error' '
322
git checkout HEAD^ &&
323
test_must_fail git submodule update &&
324
(cd submodule2 &&
325
- git rev-parse --max-count=1 HEAD > ../actual
325
+ git rev-parse --verify HEAD >../actual
326
) &&
327
test_cmp expect actual
328
)
@@ -351,7 +351,7 @@ test_expect_success 'submodule update continues after recursive checkout error'
351
test_commit "update_submodule_again_again" file
352
) &&
353
(cd submodule2 &&
354
- git rev-parse --max-count=1 HEAD > ../expect &&
354
+ git rev-parse --verify HEAD >../expect &&
355
test_commit "update_submodule2_again" file
356
) &&
357
git add submodule &&
@@ -366,7 +366,7 @@ test_expect_success 'submodule update continues after recursive checkout error'
366
) &&
367
test_must_fail git submodule update --recursive &&
368
(cd submodule2 &&
369
- git rev-parse --max-count=1 HEAD > ../actual
369
+ git rev-parse --verify HEAD >../actual
370
) &&
371
test_cmp expect actual
372
)
@@ -398,12 +398,12 @@ test_expect_success 'submodule update exit immediately in case of merge conflict
398
) &&
399
git checkout HEAD^ &&
400
(cd submodule2 &&
401
- git rev-parse --max-count=1 HEAD > ../expect
401
+ git rev-parse --verify HEAD >../expect
402
) &&
403
git config submodule.submodule.update merge &&
404
test_must_fail git submodule update &&
405
(cd submodule2 &&
406
- git rev-parse --max-count=1 HEAD > ../actual
406
+ git rev-parse --verify HEAD >../actual
407
) &&
408
test_cmp expect actual
409
)
@@ -432,12 +432,12 @@ test_expect_success 'submodule update exit immediately after recursive rebase er
432
) &&
433
git checkout HEAD^ &&
434
(cd submodule2 &&
435
- git rev-parse --max-count=1 HEAD > ../expect
435
+ git rev-parse --verify HEAD >../expect
436
) &&
437
git config submodule.submodule.update rebase &&
438
test_must_fail git submodule update &&
439
(cd submodule2 &&
440
- git rev-parse --max-count=1 HEAD > ../actual
440
+ git rev-parse --verify HEAD >../actual
441
) &&
442
test_cmp expect actual
443
)