chiark / gitweb /
dgit: Provide no_local_git_config
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 28 Jun 2017 15:59:00 +0000 (16:59 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 8 Jul 2017 17:54:00 +0000 (18:54 +0100)
Part of the fix to #865863.  No callers yet, so no functional change.

This function not only arranges not to call git config --local.
Removing 'local' from @gitcfgsources also prevents various config
lookup machinery from trying to find information in $cfg{local}
now of course does not exist.

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

diff --git a/dgit b/dgit
index a009e41..51a2ccb 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -704,6 +704,11 @@ sub cfg {
        "$us: distro or suite appears not to be (properly) supported";
 }
 
+sub no_local_git_cfg () {
+    # needs to be called from pre_*
+    @gitcfgsources = grep { $_ ne 'local' } @gitcfgsources;
+}
+
 sub access_basedistro__noalias () {
     if (defined $idistro) {
        return $idistro;