Git.pm: allow command_close_bidi_pipe to be called as method

The documentation of command_close_bidi_pipe() claims that it can
be called as a method, but it does not check whether the first
argument is $self or not assuming the latter.  Using _maybe_self()
fixes this.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Michal Nazarewicz
2013-02-07 15:01:17 +01:00
committed by Junio C Hamano
parent 2f19ada7f8
commit 1bc760aeb7

View File

@ -430,7 +430,7 @@ have more complicated structure.
sub command_close_bidi_pipe {
local $?;
my ($pid, $in, $out, $ctx) = @_;
my ($self, $pid, $in, $out, $ctx) = _maybe_self(@_);
foreach my $fh ($in, $out) {
unless (close $fh) {
if ($!) {