summaryrefslogtreecommitdiff
path: root/Debian
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2017-08-02 15:52:41 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2017-08-03 09:57:01 +0100
commit15b1da549c58aed4425934594ac5fdd91222aeed (patch)
tree5993d80c74128f26b2ffc9c545705b344e3a0537 /Debian
parent7ec5b74cc4587f7473a1e787d591c07eb1f48046 (diff)
playground refactoring: Dgit.pm: Honour $maindir in fresh_playground
Previously, fresh_playground expected that the playground argument has exactly the depth .git/FOO/BAR. Now, it expects that $maindir is set. In dgit (the only caller right now) this is always true because dgit now uses fresh_playground. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'Debian')
-rw-r--r--Debian/Dgit.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm
index 27fd29a..473c01e 100644
--- a/Debian/Dgit.pm
+++ b/Debian/Dgit.pm
@@ -531,7 +531,8 @@ sub fresh_playground ($) {
sub playtree_setup (;$) {
my ($t_local_git_cfg) = @_;
$t_local_git_cfg //= $local_git_cfg;
- # should be run in a directory .git/FOO/BAR of a working tree
+ # for use in the playtree
+ # $maindir must be set, eg by calling record_maindir or fresh_playground
runcmd qw(git init -q);
runcmd qw(git config gc.auto 0);
foreach my $copy (qw(user.email user.name user.useConfigOnly
@@ -543,7 +544,7 @@ sub playtree_setup (;$) {
runcmd qw(git config), $copy, $_ foreach @$v;
}
rmtree('.git/objects');
- symlink '../../../../objects','.git/objects' or die $!;
+ symlink "$maindir/.git/objects",'.git/objects' or die $!;
ensuredir '.git/info';
open GA, "> .git/info/attributes" or die $!;
print GA "* $negate_harmful_gitattrs\n" or die $!;