Make it honour $maindir_gitdir so it will DTRT in a `git worktree'.
The .git/dgit play area ends up in the .git/worktrees/<worktreename>
for this worktree.
It now returns an absolute path. The only call site that needs
adjusting is the one in fresh_playground.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
sub ensure_a_playground_parent ($) {
my ($spc) = @_;
record_maindir();
sub ensure_a_playground_parent ($) {
my ($spc) = @_;
record_maindir();
+ $spc = "$maindir_gitdir/$spc";
my $parent = dirname $spc;
mkdir $parent or $!==EEXIST
or fail "failed to mkdir playground parent $parent: $!";
my $parent = dirname $spc;
mkdir $parent or $!==EEXIST
or fail "failed to mkdir playground parent $parent: $!";
$spc = ensure_a_playground_parent $spc;
rmtree $spc;
mkdir $spc or die "$spc $!";
$spc = ensure_a_playground_parent $spc;
rmtree $spc;
mkdir $spc or die "$spc $!";
- return $playground = "$maindir/$spc";
+ return $playground = $spc;
}
# ----- playtrees -----
}
# ----- playtrees -----