diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-08-02 19:19:38 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-08-03 20:37:19 +0100 |
commit | 8a6027965b4f02552cf754f9ec081e35c7174146 (patch) | |
tree | 375ff6e62f8f18f6cf7021958d54c71bb67f721d /Debian | |
parent | 37923577e345babd9e21382449147053ed063f44 (diff) |
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 <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'Debian')
-rw-r--r-- | Debian/Dgit.pm | 7 |
1 files changed, 6 insertions, 1 deletions
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 $!; |