summaryrefslogtreecommitdiff
path: root/perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-04-22 11:26:55 -0700
committerJunio C Hamano <gitster@pobox.com>2013-04-22 11:26:55 -0700
commit2483fba54e9a870e110448cd463c10684d45ed36 (patch)
treecab12fe722e2a9ffd82bcf386fb6457fcd7b7707 /perl
parent2903c28ebb04ad99722cd0f99a4fe09c5f3e8aa0 (diff)
parenta749c0bbef068af339ea1ac8843f8ca307b3dd35 (diff)
downloadgit-2483fba54e9a870e110448cd463c10684d45ed36.tar.gz
Merge branch 'tr/perl-keep-stderr-open' into maint
* tr/perl-keep-stderr-open: t9700: do not close STDERR perl: redirect stderr to /dev/null instead of closing
Diffstat (limited to 'perl')
-rw-r--r--perl/Git.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/perl/Git.pm b/perl/Git.pm
index f207b47183..a69467feaa 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -1335,12 +1335,12 @@ sub _command_common_pipe {
if (not defined $pid) {
throw Error::Simple("open failed: $!");
} elsif ($pid == 0) {
- if (defined $opts{STDERR}) {
- close STDERR;
- }
if ($opts{STDERR}) {
open (STDERR, '>&', $opts{STDERR})
or die "dup failed: $!";
+ } elsif (defined $opts{STDERR}) {
+ open (STDERR, '>', '/dev/null')
+ or die "opening /dev/null failed: $!";
}
_cmd_exec($self, $cmd, @args);
}