chiark / gitweb /
dgit: simplify gitattrs setup in mktree_in_ud_here
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 10 Jul 2017 10:19:27 +0000 (11:19 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 18 Jul 2017 21:08:43 +0000 (22:08 +0100)
We are going to want to break the meat of mktree_in_ud here out into
Dgit.pm.  Dgit.pm doesn't have access_cfg, is_gitattrs_setup, and so
on.

On the other hand, we don't need any of that here: this is a fresh
tree of our own (so there is no existing .git/info/attributes to
combine with our new settings), and we ignore the config already.

So overall, little functional change: the .git/info/attributes in our
private working areas are now slightly simpler: they don't indirect
via git-defuse-attrs.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index 3cf7705dd052d8b6a1bb15737486bf9911ed686c..ef608732f162de8b2a197446e4ce7e87807809ca 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -1717,7 +1717,10 @@ sub mktree_in_ud_here () {
     }
     rmtree('.git/objects');
     symlink '../../../../objects','.git/objects' or die $!;
-    setup_gitattrs(1);
+    ensuredir '.git/info';
+    open GA, "> .git/info/attributes" or die $!;
+    print GA "* $negate_harmful_gitattrs\n" or die $!;
+    close GA or die $!;
 }
 
 sub git_write_tree () {