diff options
author | Jeff King <peff@peff.net> | 2023-04-27 11:14:06 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-04-27 18:53:32 +0300 |
commit | 2063b86b815d9193f789e9e10dae0d513ea327fa (patch) | |
tree | 642ba07c23a63ba75c50f3c5cc67154c56f4aed5 /t/t4212-log-corrupt.sh | |
parent | 73876f4861cd3d187a4682290ab75c9dccadbc56 (diff) |
t4212: avoid putting git on left-hand side of pipe
We wouldn't expect cat-file to fail here, but it's good practice to
avoid putting git on the upstream of a pipe, as we otherwise ignore its
exit code.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4212-log-corrupt.sh')
-rwxr-xr-x | t/t4212-log-corrupt.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/t/t4212-log-corrupt.sh b/t/t4212-log-corrupt.sh index e89e1f54b6..8b5433ea74 100755 --- a/t/t4212-log-corrupt.sh +++ b/t/t4212-log-corrupt.sh @@ -8,8 +8,9 @@ TEST_PASSES_SANITIZE_LEAK=true test_expect_success 'setup' ' test_commit foo && - git cat-file commit HEAD | - sed "/^author /s/>/>-<>/" >broken_email.commit && + git cat-file commit HEAD >ok.commit && + sed "/^author /s/>/>-<>/" <ok.commit >broken_email.commit && + git hash-object --literally -w -t commit broken_email.commit >broken_email.hash && git update-ref refs/heads/broken_email $(cat broken_email.hash) ' |