File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1335,12 +1335,12 @@ sub _command_common_pipe {
13351335 if (not defined $pid ) {
13361336 throw Error::Simple(" open failed: $! " );
13371337 } elsif ($pid == 0) {
1338- if (defined $opts {STDERR }) {
1339- close STDERR ;
1340- }
13411338 if ($opts {STDERR }) {
13421339 open (STDERR , ' >&' , $opts {STDERR })
13431340 or die " dup failed: $! " ;
1341+ } elsif (defined $opts {STDERR }) {
1342+ open (STDERR , ' >' , ' /dev/null' )
1343+ or die " opening /dev/null failed: $! " ;
13441344 }
13451345 _cmd_exec($self , $cmd , @args );
13461346 }
Original file line number Diff line number Diff line change 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" ;
4950is($r -> config(" test.dupstring" ), " value2" , " config: multivar" );
5051eval { $r -> config_bool(" test.boolother" ) };
5152ok($@ , " config_bool: non-boolean values fail" );
You can’t perform that action at this time.
0 commit comments