From 33b3c4012778bbc2a94f9a66f4b17bfe29e5fa00 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 2 Aug 2017 19:17:14 +0100 Subject: worktree support: Fix ensure_a_playground (gives absolute path now) Make it honour $maindir_gitdir so it will DTRT in a `git worktree'. The .git/dgit play area ends up in the .git/worktrees/ 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 --- Debian/Dgit.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Debian') diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index b678ba5..52e192e 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -543,7 +543,7 @@ our $playground; 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: $!"; @@ -562,7 +562,7 @@ sub fresh_playground ($) { $spc = ensure_a_playground_parent $spc; rmtree $spc; mkdir $spc or die "$spc $!"; - return $playground = "$maindir/$spc"; + return $playground = $spc; } # ----- playtrees ----- -- cgit v1.2.3