Git.pm: allow command_close_bidi_pipe to be called as method
authorMichal Nazarewicz <mina86@mina86.com>
Thu, 7 Feb 2013 14:01:17 +0000 (15:01 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 7 Feb 2013 18:37:13 +0000 (10:37 -0800)
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>
perl/Git.pm
index 931047c51da22cddefe0eab08d0fdaa595daefef..bbb753a0ac2b4dbff8b618d25b3efbc42f9ea9e0 100644 (file)
@@ -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 ($!) {