From: Jonathan Nieder Date: Thu, 15 Apr 2010 01:27:52 GMT Subject: Re: [PATCH] t7006: guard cleanup with test_expect_success Message-ID: <20100415012752.GA17132@progeny.tock> In-Reply-To: <7v7ho9mt3a.fsf@alter.siamese.dyndns.org> Junio C Hamano wrote: > Jonathan Nieder writes: [...] >> +cleanup_fail() { >> + echo >&2 cleanup failed >> + exit 1 >> +} > > I think you meant to say "false" or "(exit 1)" here. To see why... [...] > ... try your patch with "rm -f stdout_is_tty" replaced with "(exit 1)" to > see how your cleanup_fail behaves. Good catch; thanks. Here’s a patch for squashing in case you would like one. diff --git a/t/t7006-pager.sh b/t/t7006-pager.sh index 62595ab..a3d0210 100755 --- a/t/t7006-pager.sh +++ b/t/t7006-pager.sh @@ -6,7 +6,7 @@ test_description='Test automatic use of a pager.' cleanup_fail() { echo >&2 cleanup failed - exit 1 + return 1 } test_expect_success 'set up terminal for tests' '