summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Green <sgreen@redhat.com>2014-05-08 07:43:49 +0200
committerByron Jones <glob@mozilla.com>2014-05-08 07:43:49 +0200
commit02954330c3c5f4d13dc4b4c287af21edff64043f (patch)
treebae693fdd9eea281fd12fdb04917a9887c5720d8
parente4d5d3452cad0d82aec7880fc236f6c3af8bf514 (diff)
downloadbugzilla-02954330c3c5f4d13dc4b4c287af21edff64043f.tar.gz
bugzilla-02954330c3c5f4d13dc4b4c287af21edff64043f.tar.xz
Bug 1007493: Allow non login git commits to be linked
-rw-r--r--extensions/BMO/Extension.pm2
-rw-r--r--extensions/BMO/t/bug_format_comment.t7
2 files changed, 7 insertions, 2 deletions
diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm
index 4e5972d2d..f811c7a3b 100644
--- a/extensions/BMO/Extension.pm
+++ b/extensions/BMO/Extension.pm
@@ -482,7 +482,7 @@ sub bug_format_comment {
# link git.mozilla.org commit messages
push (@$regexes, {
- match => qr#^(To\s(?:ssh://)?[^\@]+\@git\.mozilla\.org[:/](.+?\.git)\n
+ match => qr#^(To\s(?:ssh://)?(?:[^\@]+\@)?git\.mozilla\.org[:/](.+?\.git)\n
\s+)([0-9a-z]+\.\.([0-9a-z]+)\s+\S+\s->\s\S+)#mx,
replace => sub {
my $args = shift;
diff --git a/extensions/BMO/t/bug_format_comment.t b/extensions/BMO/t/bug_format_comment.t
index 99c17da9e..0356684e9 100644
--- a/extensions/BMO/t/bug_format_comment.t
+++ b/extensions/BMO/t/bug_format_comment.t
@@ -39,9 +39,13 @@ Committed revision 9257.
To gitolite3@git.mozilla.org:bugzilla/bugzilla.git
36f56bd..eab44b1 nouri -> nouri
-# git with uri
+# git with uri (with login)
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git
36f56bd..eab44b1 withuri -> withuri
+
+# git with uri (without login)
+To ssh://git.mozilla.org/bugzilla/bugzilla.git
+ 36f56bd..eab44b1 nologin -> nologin
END_OF_LINKS
my @regexes;
@@ -68,6 +72,7 @@ my @links = (
'<a href="http://viewvc.svn.mozilla.org/vc?view=rev&amp;revision=2424">r2424</a>',
'<a href="http://git.mozilla.org/?p=bugzilla/bugzilla.git;a=commit;h=eab44b1">36f56bd..eab44b1 withuri -> withuri</a>',
'<a href="http://git.mozilla.org/?p=bugzilla/bugzilla.git;a=commit;h=eab44b1">36f56bd..eab44b1 nouri -> nouri</a>',
+ '<a href="http://git.mozilla.org/?p=bugzilla/bugzilla.git;a=commit;h=eab44b1">36f56bd..eab44b1 nologin -> nologin</a>',
'http://bzr.mozilla.org/bmo/4.2/revision/9257',
);