From 8a6027965b4f02552cf754f9ec081e35c7174146 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 2 Aug 2017 19:19:38 +0100 Subject: worktree support: Fix playtree_setup In a worktree, .git is not a directory. We need to use $maindir_common. Add a comment, too. Signed-off-by: Ian Jackson --- Debian/Dgit.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Debian/Dgit.pm') diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index 52e192e..3abb174 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -582,8 +582,13 @@ sub playtree_setup (;$) { 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 $!; -- cgit v1.2.3