chiark / gitweb /
Don't try and parse username/password out of repo address except for svn
authorCiaran Gultnieks <ciaran@ciarang.com>
Wed, 2 Oct 2013 09:25:26 +0000 (10:25 +0100)
committerCiaran Gultnieks <ciaran@ciarang.com>
Wed, 2 Oct 2013 09:25:26 +0000 (10:25 +0100)
fdroidserver/common.py

index ad49d4aad7b29999b9d3197d360f6800a22b21bc..dda00f026860789a443fe59c3d62e7a5baad8147 100644 (file)
@@ -53,19 +53,18 @@ class vcs:
         self.sdk_path = sdk_path
 
         # It's possible to sneak a username and password in with
-        # the remote address... (this really only applies to svn
-        # and we should probably be more specific!)
-        index = remote.find('@')
-        if index != -1:
-            self.username = remote[:index]
-            remote = remote[index+1:]
-            index = self.username.find(':')
-            if index == -1:
-                raise VCSException("Password required with username")
-            self.password = self.username[index+1:]
-            self.username = self.username[:index]
-        else:
-            self.username = None
+        # the remote address for svn...
+        self.username = None
+        if self.repotype() == 'svn':
+            index = remote.find('@')
+            if index != -1:
+                self.username = remote[:index]
+                remote = remote[index+1:]
+                index = self.username.find(':')
+                if index == -1:
+                    raise VCSException("Password required with username")
+                self.password = self.username[index+1:]
+                self.username = self.username[:index]
 
         self.remote = remote
         self.local = local