From: Michal Nazarewicz Date: Thu, 7 Feb 2013 14:01:17 +0000 (+0100) Subject: Git.pm: allow command_close_bidi_pipe to be called as method X-Git-Tag: v1.8.3-rc0~194^2~5 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/1bc760aeb784701a702c0a306d464834e96b1f3d 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 Signed-off-by: Junio C Hamano --- diff --git a/perl/Git.pm b/perl/Git.pm index 931047c51d..bbb753a0ac 100644 --- a/perl/Git.pm +++ b/perl/Git.pm @@ -430,7 +430,7 @@ sub command_bidi_pipe { 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 ($!) {