summaryrefslogtreecommitdiff
path: root/perl/Git.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl/Git.pm')
-rw-r--r--perl/Git.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/perl/Git.pm b/perl/Git.pm
index 8fd3611..3f4080c 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -860,7 +860,13 @@ sub READLINE {
if ($self->{i} >= scalar @{$self->{data}}) {
return undef;
}
- return $self->{'data'}->[ $self->{i}++ ];
+ my $i = $self->{i};
+ if (wantarray) {
+ $self->{i} = $#{$self->{'data'}} + 1;
+ return splice(@{$self->{'data'}}, $i);
+ }
+ $self->{i} = $i + 1;
+ return $self->{'data'}->[ $i ];
}
sub CLOSE {