Skip to content

Commit

Permalink
Fixed a stupid bug that ignored only one modification
Browse files Browse the repository at this point in the history
  • Loading branch information
Getty committed Jun 5, 2012
1 parent 6c9acef commit 1f60d29
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/Git/Wrapper.pm
Expand Up @@ -218,6 +218,7 @@ sub log {

if ($raw) {
my @modifications;

while(@out and $out[0] =~ m/^\:(\d{6}) (\d{6}) (\w{7})\.\.\. (\w{7})\.\.\. (\w{1})\t(.*)$/) {
push @modifications, Git::Wrapper::File::RawModification->new($6,$5,$1,$2,$3,$4);
shift @out;
Expand Down
10 changes: 9 additions & 1 deletion lib/Git/Wrapper/Log.pm
Expand Up @@ -20,7 +20,15 @@ sub id { shift->{id} }

sub attr { shift->{attr} }

sub modifications { my $self = shift; @_ > 1 ? ($self->{modifications} = [@_]) : @{$self->{modifications}} }
sub modifications {
my $self = shift;
if (@_ > 0) {
$self->{modifications} = [@_];
return scalar @{$self->{modifications}};
} else {
return @{$self->{modifications}};
}
}

sub message { @_ > 1 ? ($_[0]->{message} = $_[1]) : $_[0]->{message} }

Expand Down

0 comments on commit 1f60d29

Please sign in to comment.