t9001: fix broken "invoke hook" test

This test has been dysfunctional since it was added by 6489660b4b (send-email: support validate hook, 2017-05-12), however, the problem went unnoticed due to a broken &&-chain late in the test. The test wants to verify that a non-zero exit code from the 'sendemail-validate' hook causes git-send-email to abort with a particular error message. A command which is expected to fail should be run with 'test_must_fail', however, the test neglects to do so. Fix this problem, as well as the broken &&-chain behind which the problem hid. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Eric Sunshine committed Jul 1, 2018 at 20:23 UTC be8c48d4c4e42a7fe879241ca4e52325dd4f96f0
1 file changed +2 -2
t/t9001-send-email.sh
+2 -2
@@ -1966,11 +1966,11 @@ test_expect_success $PREREQ 'invoke hook' '
1966
1967 # Verify error message when a patch is rejected by the hook
1968 sed -e "s/add master/x/" ../0001-add-master.patch >../another.patch &&
1969 - git send-email \
1969 + test_must_fail git send-email \
1970 --from="Example <nobody@example.com>" \
1971 --to=nobody@example.com \
1972 --smtp-server="$(pwd)/../fake.sendmail" \
1973 - ../another.patch 2>err
1973 + ../another.patch 2>err &&
1974 test_i18ngrep "rejected by sendemail-validate hook" err
1975 )
1976 '