chiark / gitweb /
dgit: Fix suggested diff rune in split brain mode
[dgit.git] / Debian / Dgit.pm
index 52e192e2ee0ed646e5887ba8266c2275dcc99ec9..c4a61af1f081b62f21938ac86783a0deef000286 100644 (file)
@@ -561,7 +561,7 @@ sub fresh_playground ($) {
     my ($spc) = @_;
     $spc = ensure_a_playground_parent $spc;
     rmtree $spc;
-    mkdir $spc or die "$spc $!";
+    mkdir $spc or fail "failed to mkdir the playground $spc: $!";
     return $playground = $spc;
 }
 
@@ -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 $!;