CPAN-InGit
view release on metacpan or search on metacpan
lib/CPAN/InGit/MutableTree.pm view on Meta::CPAN
sub _mkfile($path, $scalarref, $mode) {
open my $fh, '>', $path or die "open($path): $!";
$fh->print($$scalarref) or die "write($path): $!";
$fh->close or die "close($path): $!";
chmod($path, $mode) || die "chmod($path, $mode): $!"
if defined $mode && $mode != 0100644;
}
sub update_tree($self) {
# If using the Index, the index can write the new tree
if ($self->use_workdir) {
$self->tree($self->git_repo->index->write_tree);
} else {
$self->tree(_assemble_tree($self->git_repo, $self->tree, $self->_changes));
$self->_changes({}); # reset the changes hash
}
# don't reset has_changes until it has been committed
}
( run in 0.569 second using v1.01-cache-2.11-cpan-13bb782fe5a )