Skip to content

Commit a749c0b

Browse files
Thomas Rastgitster
authored andcommitted
t9700: do not close STDERR
Much like the previous patch, this triggered an unrelated bug. Closing STDERR is not worth it anyway, as we risk writing die() and such to random files that happen to be subsequently opened on FD 2. Don't do it. Signed-off-by: Thomas Rast <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bd4ca09 commit a749c0b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

t/t9700/test.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ BEGIN
4545
# Failure cases for config:
4646
# Save and restore STDERR; we will probably extract this into a
4747
# "dies_ok" method and possibly move the STDERR handling to Git.pm.
48-
open our $tmpstderr, ">&STDERR" or die "cannot save STDERR"; close STDERR;
48+
open our $tmpstderr, ">&STDERR" or die "cannot save STDERR";
49+
open STDERR, ">", "/dev/null" or die "cannot redirect STDERR to /dev/null";
4950
is($r->config("test.dupstring"), "value2", "config: multivar");
5051
eval { $r->config_bool("test.boolother") };
5152
ok($@, "config_bool: non-boolean values fail");

0 commit comments

Comments
 (0)