}
# make the commit
- my @cmd = (qw/git commit-tree -m/, $message);
- push @cmd, '-p', $parent if $parent;
+ my @cmd = qw/git commit-tree/;
push @cmd, $tree;
- my $commit = $self->qx_sha1(join(' ', @cmd));
+ push @cmd, '-p', $parent if $parent;
+
+ # git commit-tree -m didn't work in older git versions
+ $message =~ /\A\w+\z/ or die "message must be \\w+ only\n";
+ my $commit = $self->qx_sha1("echo $message |". join(' ', @cmd));
# update the ref
@cmd = (qw/git update-ref/, $ref, $commit);