Subject: | Git::PurePerl can read merge commits, but can't create them |
There is a major difference between Git::PurePerl::Object::Commit and Git::PurePerl::NewObject::Commit:
Git::PurePerl::Object::Commit:
has 'parent_sha1s' => ( is => 'rw', isa => 'ArrayRef[Str]', required => 0, default => sub { [] });
Git::PurePerl::NewObject::Commit:
has 'parent' => ( is => 'rw', isa => 'Str', required => 0 );
And the _build_content method does this:
$content .= 'parent ' . $self->parent . "\n" if $self->parent;
A merge commit (i.e. a commit with multiple parents) will have several parent lines, like the following example:
$ git cat-file commit 624df47
tree 6ccdcded4d3c76fb3b3f325681a19e12ba089df3
parent a80ffe83da85cf09fcf6ae120c1e6e1102c7dce9
parent 985ba2c9db420f79ecec6fd9e414ea4d9723c955
author Philippe Bruhat (BooK) <book@cpan.org> 1459553505 +0200
committer Philippe Bruhat (BooK) <book@cpan.org> 1459553505 +0200
Merge branch 'test-requires-git'