t5318-commit-graph: use 'test_expect_code'

In 't5318-commit-graph.sh' the test 'close with correct error on bad input' manually verifies the exit code of a 'git commit-graph write' command. Use 'test_expect_code' instead. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Acked-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

SZEDER Gábor committed Aug 5, 2019 at 10:02 UTC 9916073be5dc59997e7cb9f7577bc7c91fd8f44a
1 file changed +1 -2
t/t5318-commit-graph.sh
+1 -2
@@ -26,8 +26,7 @@ test_expect_success 'write graph with no packs' '
26 test_expect_success 'close with correct error on bad input' '
27 cd "$TRASH_DIRECTORY/full" &&
28 echo doesnotexist >in &&
29 - { git commit-graph write --stdin-packs <in 2>stderr; ret=$?; } &&
30 - test "$ret" = 1 &&
29 + test_expect_code 1 git commit-graph write --stdin-packs <in 2>stderr &&
30 test_i18ngrep "error adding pack" stderr
31 '
32