From 264ceb41d6774b3f9338e50bc7e972d18121fa99 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Mon, 7 Oct 2013 10:16:42 +0000 Subject: mgagit: Fix post-receive mailer. * Fix python path * Fix .git suffix stripping from repo shortname * Remove left over debug printing --- deployment/mgagit/templates/git-post-receive-hook | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'deployment/mgagit/templates') 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.+?)$') + REPO_NAME_RE = re.compile(r'^/git/(?P.+?)(?:\.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: -- cgit v1.2.1