Skip to content

Commit dca675c

Browse files
rybakgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Andrei Rybak <[email protected]> Reviewed-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 59162ec commit dca675c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/t1502-rev-parse-parseopt.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,14 +302,14 @@ test_expect_success 'test --parseopt help output: "wrapped" options normal "or:"
302302
|EOF
303303
END_EXPECT
304304
305-
test_must_fail git rev-parse --parseopt -- -h >out <spec >actual &&
305+
test_must_fail git rev-parse --parseopt -- -h <spec >actual &&
306306
test_cmp expect actual
307307
'
308308

309309
test_expect_success 'test --parseopt invalid opt-spec' '
310310
test_write_lines x -- "=, x" >spec &&
311311
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 &&
313313
test_cmp expect err
314314
'
315315

@@ -339,7 +339,7 @@ test_expect_success 'test --parseopt help output: multi-line blurb after empty l
339339
|EOF
340340
END_EXPECT
341341
342-
test_must_fail git rev-parse --parseopt -- -h >out <spec >actual &&
342+
test_must_fail git rev-parse --parseopt -- -h <spec >actual &&
343343
test_cmp expect actual
344344
'
345345

0 commit comments

Comments
 (0)