chiark / gitweb /
Dgit.pm: workarea_setup: Break out from dgit
[dgit.git] / dgit
diff --git a/dgit b/dgit
index 54ba4d65f6a3cc2910b13bed2cbe9b13199763c5..89f496d7e72f8a698a6d8bdbd7b817ad354edf4f 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -1705,19 +1705,7 @@ sub prep_ud (;$) {
 }
 
 sub mktree_in_ud_here () {
-    runcmd qw(git init -q);
-    runcmd qw(git config gc.auto 0);
-    foreach my $copy (qw(user.email user.name user.useConfigOnly
-                         core.sharedRepository
-                         core.compression core.looseCompression
-                         core.bigFileThreshold core.fsyncObjectFiles)) {
-       my $v = $gitcfgs{local}{$copy};
-       next unless $v;
-       runcmd qw(git config), $copy, $_ foreach @$v;
-    }
-    rmtree('.git/objects');
-    symlink '../../../../objects','.git/objects' or die $!;
-    setup_gitattrs(1);
+    workarea_setup $gitcfgs{local};
 }
 
 sub git_write_tree () {
@@ -3378,7 +3366,7 @@ END
     open GAO, "> $af.new" or die $!;
     print GAO <<END or die $!;
 *      dgit-defuse-attrs
-[attr]dgit-defuse-attrs        -text -eol -crlf -ident -filter
+[attr]dgit-defuse-attrs        $negate_harmful_gitattrs
 # ^ see GITATTRIBUTES in dgit(7) and dgit setup-new-tree in dgit(1)
 END
     my $gai = open_gitattrs();