chiark / gitweb /
New $some-user-force config variable
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 2 Nov 2014 16:52:57 +0000 (16:52 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 8 Nov 2014 22:22:20 +0000 (22:22 +0000)
This will allow dgit-distro.debian.git-user-force to be set to dgit,
but reset to '' by dgit-distro.debian/alioth.git-user-force, so that
when diverted back to alioth, we fall back to the previously-specified
username.

dgit

diff --git a/dgit b/dgit
index af710657502fc822ac6a04e64e68329941890840..38b02e4e1b4ca07f8163b9e0ad440a2df0d1b24b 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -664,7 +664,9 @@ sub access_runeinfo ($) {
 
 sub access_someuserhost ($) {
     my ($some) = @_;
 
 sub access_someuserhost ($) {
     my ($some) = @_;
-    my $user = access_cfg("$some-user",'username');
+    my $user = access_cfg("$some-user-force", 'RETURN-UNDEF');
+    defined($user) && length($user) or
+       $user = access_cfg("$some-user",'username');
     my $host = access_cfg("$some-host");
     return length($user) ? "$user\@$host" : $host;
 }
     my $host = access_cfg("$some-host");
     return length($user) ? "$user\@$host" : $host;
 }