chiark / gitweb /
Rename $access_pushing to $access_forpush and read it via a function (nfc)
[dgit.git] / dgit
diff --git a/dgit b/dgit
index f77d11f4d25ff58a0ec25132bc6f960997b9b621..247b2432c2d7ab95ad07b86a498639f2bbbc61fa 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -447,7 +447,7 @@ our %defcfg = ('dgit.default.distro' => 'debian',
               'dgit-distro.debian.git-check' => 'url',
               'dgit-distro.debian.git-check-suffix' => '/info/refs',
               'dgit-distro.debian/push.git-url' => '',
-              'dgit-distro.debian/push.git-host' => 'dgit-git.debian.net',
+              'dgit-distro.debian/push.git-host' => 'push.dgit.debian.org',
               'dgit-distro.debian/push.git-user-force' => 'dgit',
               'dgit-distro.debian/push.git-proto' => 'git+ssh://',
               'dgit-distro.debian/push.git-path' => '/dgit/debian/repos',
@@ -547,10 +547,14 @@ sub access_quirk () {
     return ('none',undef);
 }
 
-our $access_pushing = 0;
+our $access_forpush = 0;
 
 sub pushing () {
-    $access_pushing = 1;
+    $access_forpush = 1;
+}
+
+sub access_forpush () {
+    return $access_forpush;
 }
 
 sub access_distros () {
@@ -568,7 +572,7 @@ sub access_distros () {
     unshift @l, $instead_distro;
     @l = grep { defined } @l;
 
-    if ($access_pushing) {
+    if (access_forpush()) {
        @l = map { ("$_/push", $_) } @l;
     }
     @l;
@@ -645,7 +649,7 @@ sub access_giturl (;$) {
     my ($optional) = @_;
     my $url = access_cfg('git-url','RETURN-UNDEF');
     my $suffix;
-    if (!defined $url) {
+    if (!length $url) {
        my $proto = access_cfg('git-proto', 'RETURN-UNDEF');
        return undef unless defined $proto;
        $url =