From 02954330c3c5f4d13dc4b4c287af21edff64043f Mon Sep 17 00:00:00 2001 From: Simon Green Date: Thu, 8 May 2014 13:43:49 +0800 Subject: Bug 1007493: Allow non login git commits to be linked --- extensions/BMO/Extension.pm | 2 +- extensions/BMO/t/bug_format_comment.t | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'extensions') 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 = ( 'r2424', '36f56bd..eab44b1 withuri -> withuri', '36f56bd..eab44b1 nouri -> nouri', + '36f56bd..eab44b1 nologin -> nologin', 'http://bzr.mozilla.org/bmo/4.2/revision/9257', ); -- cgit v1.2.3-24-g4f1b