[sysadmin-bin] First check the naming maps table before raising an exception.



commit c56ffe377fe68df927a680d258aa30053563949a
Author: Andrea Veri <av gnome org>
Date:   Tue Aug 13 17:10:21 2013 +0200

    First check the naming maps table before raising an exception.

 git/post-receive-mirror-github |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/git/post-receive-mirror-github b/git/post-receive-mirror-github
index abae517..d2fb456 100755
--- a/git/post-receive-mirror-github
+++ b/git/post-receive-mirror-github
@@ -84,11 +84,12 @@ 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 "+" 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)
         if 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
 
 def get_repo_name ():


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