aboutsummaryrefslogtreecommitdiffstats
path: root/deployment/mgagit/templates
diff options
context:
space:
mode:
Diffstat (limited to 'deployment/mgagit/templates')
-rwxr-xr-xdeployment/mgagit/templates/git-post-receive-hook5
1 files changed, 2 insertions, 3 deletions
diff --git a/deployment/mgagit/templates/git-post-receive-hook b/deployment/mgagit/templates/git-post-receive-hook
index 72680d5a..aff07b17 100755
--- a/deployment/mgagit/templates/git-post-receive-hook
+++ b/deployment/mgagit/templates/git-post-receive-hook
@@ -1,4 +1,4 @@
-#! /usr/bin/env python2
+#!/usr/bin/python
import sys
import os
@@ -35,14 +35,13 @@ git_multimail.REVISION_FOOTER_TEMPLATE = git_multimail.FOOTER_TEMPLATE
# Override the Environment class to generate an apporpriate short name which is
# used in git links and as an email prefix
class LinksEnvironment(git_multimail.Environment):
- REPO_NAME_RE = re.compile(r'^/git/(?P<name>.+?)$')
+ REPO_NAME_RE = re.compile(r'^/git/(?P<name>.+?)(?:\.git)?$')
def get_repo_shortname(self):
"""Use the last part of the repo path, with ".git" stripped off if present."""
basename = os.path.abspath(self.get_repo_path())
m = self.REPO_NAME_RE.match(basename)
- print self.REPO_NAME_RE
if m:
return m.group('name')
else: