summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Rybak <rybak.a.v@gmail.com>2023-04-17 21:10:42 +0200
committerJunio C Hamano <gitster@pobox.com>2023-05-03 08:53:03 -0700
commit59162ece57738dfd928093251d4e95d87825ecf9 (patch)
tree53baf6e9c0b34994043ec1a818ab73701ec5b4e5
parenta7cae2905b8c51c564d0307cf9e8f3e53c2769c5 (diff)
downloadgit-59162ece57738dfd928093251d4e95d87825ecf9.tar.gz
t1450: don't create unused files
Test 'fsck error and recovery on invalid object type' in file t1450-fsck.sh redirects output of a failing "git fsck" invocation to files "out" and "err" to assert presence of error messages in the output of the command. Commit 31deb28f5e (fsck: don't hard die on invalid object types, 2021-10-01) changed the way assertions in this test are performed. The test doesn't compare the whole standard error with prepared file "err.expect" and it doesn't assert that standard output is empty. Don't create unused files "err.expect" and "out" in test 'fsck error and recovery on invalid object type'. Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com> Reviewed-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t1450-fsck.sh5
1 files changed, 1 insertions, 4 deletions
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
index fdb886dfe4..f49f878fdc 100755
--- a/t/t1450-fsck.sh
+++ b/t/t1450-fsck.sh
@@ -989,10 +989,7 @@ test_expect_success 'fsck error and recovery on invalid object type' '
garbage_blob=$(git hash-object --stdin -w -t garbage --literally </dev/null) &&
- cat >err.expect <<-\EOF &&
- fatal: invalid object type
- EOF
- test_must_fail git fsck >out 2>err &&
+ test_must_fail git fsck 2>err &&
grep -e "^error" -e "^fatal" err >errors &&
test_line_count = 1 errors &&
grep "$garbage_blob: object is of unknown type '"'"'garbage'"'"':" err