Merge branch 'tr/perl-keep-stderr-open' into maint
authorJunio C Hamano <gitster@pobox.com>
Mon, 22 Apr 2013 18:26:55 +0000 (11:26 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Apr 2013 18:26:55 +0000 (11:26 -0700)
* tr/perl-keep-stderr-open:
t9700: do not close STDERR
perl: redirect stderr to /dev/null instead of closing

1  2 
perl/Git.pm
diff --combined perl/Git.pm
index f207b47183a00fc02320a3785a8d4085b42259fe,4778428830a5eaf6fb9773b18a18f02f934c8820..a69467feaa73b44a5ad88abd05dd72df116c1488
@@@ -1026,7 -1026,7 +1026,7 @@@ my (%TEMP_FILEMAP, %TEMP_FILES)
  
  =item temp_acquire ( NAME )
  
 -Attempts to retreive the temporary file mapped to the string C<NAME>. If an
 +Attempts to retrieve the temporary file mapped to the string C<NAME>. If an
  associated temp file has not been created this session or was closed, it is
  created, cached, and set for autoflush and binmode.
  
@@@ -1335,12 -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);
                }