[sysadmin-bin] Check if the repository name has a plus, then check for it being on the naming maps.



commit 3548708135e48ee9861fe2d4ad522839c632c5e1
Author: Andrea Veri <av gnome org>
Date:   Tue Aug 13 17:45:58 2013 +0200

    Check if the repository name has a plus, then check for it being on the naming maps.

 git/post-receive-mirror-github |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/git/post-receive-mirror-github b/git/post-receive-mirror-github
index d2fb456..f146339 100755
--- a/git/post-receive-mirror-github
+++ b/git/post-receive-mirror-github
@@ -83,14 +83,11 @@ class GitHub:
 
         raise Exception("There was an error attempting to create the repo %s in github:\n\nStatus: 
%d\nText:\n%s" % (name, rq.status_code, rq.text))
 
-    def normalize_name (self, name):
-        if name in name_maps.keys():
+def normalize_name (name):
+        if "+" in name and name in name_maps.keys():
             return name_maps[name]
-
-        if "+" in name:
-            raise Exception("%s has a '+' character in it which is unsupported by Github.\nYou have to add 
it to the exception maps in the post-update hook." % name)
-
-        return name
+        else:
+           raise Exception("%s has a '+' character in it which is unsupported by Github.\nYou have to add it 
to the exception maps in the post-update hook." % name)
 
 def get_repo_name ():
     repo_name = os.getcwd ().split("/")[-1]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]