Re: [PATCH v3 10/13] t4014: stop losing return codes of git commands
From: Denton Liu <hidden>
Date: 2019-08-20 07:31:35
On Tue, Aug 20, 2019 at 03:19:08AM -0400, Denton Liu wrote:
quoted hunk ↗ jump to hunk
@@ -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?
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
'