push test: rely on &&-chaining instead of 'if bad; then echo Oops; fi'
When it is unclear which command from a test has failed, usual practice these days is to debug by running the test again with "sh -x" instead of relying on debugging 'echo' statements. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
848575d833
commit
5bd81c7315
|
@ -22,10 +22,8 @@ mk_test () {
|
||||||
(
|
(
|
||||||
for ref in "$@"
|
for ref in "$@"
|
||||||
do
|
do
|
||||||
git push testrepo $the_first_commit:refs/$ref || {
|
git push testrepo $the_first_commit:refs/$ref ||
|
||||||
echo "Oops, push refs/$ref failure"
|
exit
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
done &&
|
done &&
|
||||||
cd testrepo &&
|
cd testrepo &&
|
||||||
for ref in "$@"
|
for ref in "$@"
|
||||||
|
@ -328,13 +326,8 @@ test_expect_success 'push with weak ambiguity (2)' '
|
||||||
test_expect_success 'push with ambiguity' '
|
test_expect_success 'push with ambiguity' '
|
||||||
|
|
||||||
mk_test heads/frotz tags/frotz &&
|
mk_test heads/frotz tags/frotz &&
|
||||||
if git push testrepo master:frotz
|
test_must_fail git push testrepo master:frotz &&
|
||||||
then
|
|
||||||
echo "Oops, should have failed"
|
|
||||||
false
|
|
||||||
else
|
|
||||||
check_push_result $the_first_commit heads/frotz tags/frotz
|
check_push_result $the_first_commit heads/frotz tags/frotz
|
||||||
fi
|
|
||||||
|
|
||||||
'
|
'
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue