diff --git a/lib/Git/PurePerl/Object/Commit.pm b/lib/Git/PurePerl/Object/Commit.pm index 071d17e..bf5eda3 100644 --- a/lib/Git/PurePerl/Object/Commit.pm +++ b/lib/Git/PurePerl/Object/Commit.pm @@ -18,6 +18,7 @@ has 'committer' => has 'committed_time' => ( is => 'rw', isa => 'DateTime', required => 0 ); has 'comment' => ( is => 'rw', isa => 'Str', required => 0 ); has 'encoding' => ( is => 'rw', isa => 'Str', required => 0 ); +has 'gpgsig' => ( is => 'rw', isa => 'Str', required => 0 ); my %method_map = ( 'tree' => 'tree_sha1', @@ -31,10 +32,18 @@ sub BUILD { return unless $self->content; my @lines = split "\n", $self->content; my %header; + my $continuation; while ( my $line = shift @lines ) { last unless $line; + if ( $continuation and $line =~ /^ / ) { + $line =~ s/^ //; + $header{$continuation}->[-1] .= "\n$line"; + next; + } + $continuation = undef; my ( $key, $value ) = split ' ', $line, 2; push @{$header{$key}}, $value; + $continuation = $key if $key eq "gpgsig"; } $header{encoding} ||= [ $self->git->config->get(key => "i18n.commitEncoding") || "utf-8" ];