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 af71065..38b02e4 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -664,7 +664,9 @@ sub access_runeinfo ($) {
 
 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;
 }