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>
Andrei Rybak committed
Apr 17, 2023 at 21:10 UTC
59162ece57738dfd928093251d4e95d87825ecf9
1 file changed
+1
-4
t/t1450-fsck.sh
+1
-4
@@ -989,10 +989,7 @@ test_expect_success 'fsck error and recovery on invalid object type' '
989
990
garbage_blob=$(git hash-object --stdin -w -t garbage --literally </dev/null) &&
991
992
- cat >err.expect <<-\EOF &&
993
- fatal: invalid object type
994
- EOF
995
- test_must_fail git fsck >out 2>err &&
992
+ test_must_fail git fsck 2>err &&
993
grep -e "^error" -e "^fatal" err >errors &&
994
test_line_count = 1 errors &&
995
grep "$garbage_blob: object is of unknown type '"'"'garbage'"'"':" err