tests: move test for rebase messages from t3400 to t3406
[gitweb.git] / perl / Git.pm
index 650db90853c6ff2a769e981afd2954ffbb97469c..7a252ef872c92213c8dcd2144a84cdcf787e586a 100644 (file)
@@ -1265,7 +1265,7 @@ sub _temp_cache {
                        $tmpdir = $self->repo_path();
                }
 
-               ($$temp_fd, $fname) = File::Temp->tempfile(
+               ($$temp_fd, $fname) = File::Temp::tempfile(
                        'Git_XXXXXX', UNLINK => 1, DIR => $tmpdir,
                        ) or throw Error::Simple("couldn't open new temp file");
 
@@ -1489,12 +1489,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);
                }