diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-07-30 10:51:52 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-07-30 10:52:29 -0700 |
commit | ad6a599c0a98441e3da0aaeb44bd39a167cb0693 (patch) | |
tree | e20ab3688f6dd265365d0980462dcb620c2e25bf /t/t7406-submodule-update.sh | |
parent | 15ffb7cde48b73b3d5ce259443db7d2e0ba13750 (diff) | |
download | git-ad6a599c0a98441e3da0aaeb44bd39a167cb0693.tar.gz |
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>
Diffstat (limited to 't/t7406-submodule-update.sh')
-rwxr-xr-x | t/t7406-submodule-update.sh | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh index 807f761147..f4e6602c2d 100755 --- a/t/t7406-submodule-update.sh +++ b/t/t7406-submodule-update.sh @@ -305,7 +305,7 @@ test_expect_success 'submodule update continues after checkout error' ' git submodule init && git commit -am "new_submodule" && (cd submodule2 && - git rev-parse --max-count=1 HEAD > ../expect + git rev-parse --verify HEAD >../expect ) && (cd submodule && test_commit "update_submodule" file @@ -322,7 +322,7 @@ test_expect_success 'submodule update continues after checkout error' ' git checkout HEAD^ && test_must_fail git submodule update && (cd submodule2 && - git rev-parse --max-count=1 HEAD > ../actual + git rev-parse --verify HEAD >../actual ) && test_cmp expect actual ) @@ -351,7 +351,7 @@ test_expect_success 'submodule update continues after recursive checkout error' test_commit "update_submodule_again_again" file ) && (cd submodule2 && - git rev-parse --max-count=1 HEAD > ../expect && + git rev-parse --verify HEAD >../expect && test_commit "update_submodule2_again" file ) && git add submodule && @@ -366,7 +366,7 @@ test_expect_success 'submodule update continues after recursive checkout error' ) && test_must_fail git submodule update --recursive && (cd submodule2 && - git rev-parse --max-count=1 HEAD > ../actual + git rev-parse --verify HEAD >../actual ) && test_cmp expect actual ) @@ -398,12 +398,12 @@ test_expect_success 'submodule update exit immediately in case of merge conflict ) && git checkout HEAD^ && (cd submodule2 && - git rev-parse --max-count=1 HEAD > ../expect + git rev-parse --verify HEAD >../expect ) && git config submodule.submodule.update merge && test_must_fail git submodule update && (cd submodule2 && - git rev-parse --max-count=1 HEAD > ../actual + git rev-parse --verify HEAD >../actual ) && test_cmp expect actual ) @@ -432,12 +432,12 @@ test_expect_success 'submodule update exit immediately after recursive rebase er ) && git checkout HEAD^ && (cd submodule2 && - git rev-parse --max-count=1 HEAD > ../expect + git rev-parse --verify HEAD >../expect ) && git config submodule.submodule.update rebase && test_must_fail git submodule update && (cd submodule2 && - git rev-parse --max-count=1 HEAD > ../actual + git rev-parse --verify HEAD >../actual ) && test_cmp expect actual ) |