sub ensure_a_playground_parent ($) {
my ($spc) = @_;
record_maindir();
- $spc = ".git/$spc";
+ $spc = "$maindir_gitdir/$spc";
my $parent = dirname $spc;
mkdir $parent or $!==EEXIST
or fail "failed to mkdir playground parent $parent: $!";
my ($spc) = @_;
$spc = ensure_a_playground_parent $spc;
rmtree $spc;
- mkdir $spc or die "$spc $!";
- return $playground = "$maindir/$spc";
+ mkdir $spc or fail "failed to mkdir the playground $spc: $!";
+ return $playground = $spc;
}
# ----- playtrees -----
next unless $v;
runcmd qw(git config), $copy, $_ foreach @$v;
}
+ # this is confusing: we have
+ # . playtree, not a worktree, has .git/, our cwd
+ # $maindir might be a worktree so
+ # $maindir_gitdir contains our main working "dgit", HEAD, etc.
+ # $maindir_gitcommon the shared stuff, including .objects
rmtree('.git/objects');
- symlink "$maindir/.git/objects",'.git/objects' or die $!;
+ symlink "$maindir_gitcommon/objects",'.git/objects' or die $!;
ensuredir '.git/info';
open GA, "> .git/info/attributes" or die $!;
print GA "* $negate_harmful_gitattrs\n" or die $!;