Re: [PATCH v3 10/13] t4014: stop losing return codes of git commands
- From
Denton Liu <liu.denton@gmail.com>
- Date
- Aug 20, 2019, 07:31 UTC
- Message-ID
- <20190820073130.GA32049@archbookpro.localdomain>
- In-Reply-To
- <64069c0c540b109b46b2cc6c90e3b5c912aa18c5.1566285151.git.liu.denton@gmail.com>
On Tue, Aug 20, 2019 at 03:19:08AM -0400, Denton Liu wrote:
Show 8 quoted lines
> @@ -808,20 +821,24 @@ test_expect_success 'format-patch --ignore-if-in-upstream HEAD' ' > git format-patch --ignore-if-in-upstream HEAD > ' > > -git_version="$(git --version | sed "s/.* //")" > +test_expect_success 'get git version' ' > + git_version="$(git --version | sed "s/.* //")" > +'
Oops, this should read
git_version="$(git --version >version && sed "s/.* //" <version)"
Anyway, I was considering keeping the upstream pipe but it feels very weird having an unchecked Git command (especially since, from what I can tell, `git --version` isn't tested anywhere else). Thoughts?
Show 20 quoted lines
>
> signature() {
> printf "%s\n%s\n\n" "-- " "${1:-$git_version}"
> }
>
> test_expect_success 'format-patch default signature' '
> - git format-patch --stdout -1 | tail -n 3 >output &&
> + git format-patch --stdout -1 >patch &&
> + tail -n 3 patch >output &&
> signature >expect &&
> test_cmp expect output
> '
>
> test_expect_success 'format-patch --signature' '
> - git format-patch --stdout --signature="my sig" -1 | tail -n 3 >output &&
> + git format-patch --stdout --signature="my sig" -1 >patch &&
> + tail -n 3 patch >output &&
> signature "my sig" >expect &&
> test_cmp expect output
> '