t9300-fast-import: avoid 'exit' in test_expect_success snippets
commit05880b02221dc8da136e9febfa7853ad822b1ee1
authorJohannes Sixt <j6t@kdbg.org>
Fri, 20 Apr 2012 06:25:09 +0000 (20 08:25 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Apr 2012 20:38:51 +0000 (20 13:38 -0700)
tree5e174789e72ad92c264f2577d1257200f1b1ff2d
parente8dde3e5f9ddb7cf95a6ff3cea6cf07c3a2db80d
t9300-fast-import: avoid 'exit' in test_expect_success snippets

Exiting from a for-loop early using '|| break' does not propagate the
failure code, and for this reason, the tests used just 'exit'. But this
ends the test script with 'FATAL: Unexpected exit code 1' in the case of
a failed test.

Fix this by moving the loop into a shell function, from which we can
simply return early.

While at it, modernize the style of the affected test cases.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t9300-fast-import.sh