Re: [PATCH v2 0/3] diff: build parseopts array on demand
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Dec 1, 2022, 19:19 UTC
- Message-ID
- <CAPig+cTdSNfWwN-c7R3-MF6ipAD6-7aVjxRK9f9XaKzg4yhhyg@mail.gmail.com>
- In-Reply-To
- <572e29a2-3f19-e946-d152-009999651084@web.de>
On Thu, Dec 1, 2022 at 2:11 PM René Scharfe <l.s.r@web.de> wrote:
Show 15 quoted lines
> t4205-log-pretty-formats.sh (Wstat: 256 Tests: 21 Failed: 0) > Non-zero exit status: 1 > Parse errors: No plan found in TAP output > > The TAP error in t4205-log-pretty-formats.sh is fixed by the following > patch, but I can't explain it: > > diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh > @@ -156,7 +156,7 @@ test_expect_success 'NUL termination with --reflog --pretty=oneline' ' > for r in $revs > do > git show -s --pretty=oneline "$r" >raw && > - cat raw | lf_to_nul || exit 1 > + cat raw | lf_to_nul || return 1 > done >expect &&
Makes sense. The `exit 1` undesirably causes the entire script to abort, which means test_done() is never invoked, whereas `return 1` makes only the test fail. `exit 1` would be appropriate inside a subshell but there is no subshell here.