diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-08-02 19:17:14 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-08-03 18:14:59 +0100 |
commit | 33b3c4012778bbc2a94f9a66f4b17bfe29e5fa00 (patch) | |
tree | b9c9a17ecbf7ef86043e853239ca6a1803645bb7 | |
parent | 9e4421b0f366840ee6935acc6b077224173e893f (diff) |
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/<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>
-rw-r--r-- | Debian/Dgit.pm | 4 |
1 files changed, 2 insertions, 2 deletions
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 ----- |