CPAN-InGit
view release on metacpan or search on metacpan
lib/CPAN/InGit/MutableTree.pm view on Meta::CPAN
}
return undef;
}
sub set_path($self, $path, $data, %opts) {
# Two modes: we can be writing to the working directory and index, or be building a new tree
# (which may or may not be connected to a branch)
my $repo= $self->git_repo;
my $mode= $opts{mode} // 0100644;
my @path= split m{/+}, $path;
my $basename= pop @path;
if ($self->use_workdir) {
my $fullpath= $self->git_repo->workdir;
# create missing directories
for (@path) {
$fullpath .= '/'.$_;
mkdir $fullpath || die "mkdir($fullpath): $!"
unless -d $fullpath;
}
$fullpath .= '/'.$basename;
( run in 2.319 seconds using v1.01-cache-2.11-cpan-483215c6ad5 )