Skip to contentSkip to conversation

simplify control flow in cvs pserver auth

PATCH In review Áshin László 1 participant 1 message Jun 15, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 2703392615631579763@unknownmsgid

#1 lore raw

PATCH 2/5 simplify control flow in cvs pserver auth

---
 git-cvsserver.perl |   16 +++++++---------

 1 files changed, 7 insertions(+), 9 deletions(-)
git-cvsserver.perl +0 -0
index c89d999..10dcc65 100755
@@ -231,18 +231,12 @@ if ($state->{method} eq 'pserver') {

        }

        # Fall through to LOVE
-    } else {
-        # Trying to authenticate a user
-        if (not exists $cfg->{gitcvs}->{authdb}) {
-            print "E the repo config file needs a [gitcvs] section with an 'authdb' parameter set to the filename of the authentication database\n";
-            print "I HATE YOU\n";
-            exit 1;
-        }
-
+    } elsif (exists $cfg->{gitcvs}->{authdb}) {
        my $authdb = $cfg->{gitcvs}->{authdb};

        unless (-e $authdb) {
-            print "E The authentication database specified in [gitcvs.authdb] does not exist\n";
+            print "E The authentication database specified in " .
+                "[gitcvs.authdb] does not exist\n"; print "I HATE YOU\n";
            exit 1;
        }
@@ -264,6 +258,10 @@ if ($state->{method} eq 'pserver') { }

        # Fall through to LOVE
+    } else {
+        print "E Unable to find a usable authentication method\n";
+        print "I HATE YOU\n";
+        exit 1;
    }

    # For checking whether the user is anonymous on commit --
1.7.0.4