t1502: don't create unused files

Three tests in file t1502-rev-parse-parseopt.sh use three redirections with invocation of "git rev-parse --parseopt --". All three tests redirect standard output to file "out" and file "spec" to standard input. Two of the tests redirect standard output a second time to file "actual", and the third test redirects standard error to file "err". These tests check contents of files "actual" and "err", but don't use the files named "out" for assertions. The two tests that redirect to standard output twice might also be confusing to the reader. Don't redirect standard output of "git rev-parse" to file "out" in t1502-rev-parse-parseopt.sh to avoid creating unnecessary files. Acked-by: Øystein Walle <oystwa@gmail.com> 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 dca675c6ef9b1d649adfb5a6cfdf2e7c32f18928
1 file changed +3 -3
t/t1502-rev-parse-parseopt.sh
+3 -3
@@ -302,14 +302,14 @@ test_expect_success 'test --parseopt help output: "wrapped" options normal "or:"
302 |EOF
303 END_EXPECT
304
305 - test_must_fail git rev-parse --parseopt -- -h >out <spec >actual &&
305 + test_must_fail git rev-parse --parseopt -- -h <spec >actual &&
306 test_cmp expect actual
307 '
308
309 test_expect_success 'test --parseopt invalid opt-spec' '
310 test_write_lines x -- "=, x" >spec &&
311 echo "fatal: missing opt-spec before option flags" >expect &&
312 - test_must_fail git rev-parse --parseopt -- >out <spec 2>err &&
312 + test_must_fail git rev-parse --parseopt -- <spec 2>err &&
313 test_cmp expect err
314 '
315
@@ -339,7 +339,7 @@ test_expect_success 'test --parseopt help output: multi-line blurb after empty l
339 |EOF
340 END_EXPECT
341
342 - test_must_fail git rev-parse --parseopt -- -h >out <spec >actual &&
342 + test_must_fail git rev-parse --parseopt -- -h <spec >actual &&
343 test_cmp expect actual
344 '
345