Skip to content

Commit 31db43b

Browse files
authored
Merge pull request #176 from MartinNowak/fix175
fix #175 - only match first Bugzilla reference
2 parents 7885c29 + 51f5fda commit 31db43b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

source/dlangbot/bugzilla.d

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@ auto matchIssueRefs(string message)
2626

2727
// see https://github.com/github/github-services/blob/2e886f407696261bd5adfc99b16d36d5e7b50241/lib/services/bugzilla.rb#L155
2828
enum issueRE = ctRegex!(`((close|fix|address)e?(s|d)? )?(ticket|bug|tracker item|issue)s?:? *([\d ,\+&#and]+)`, "i");
29-
return message.matchAll(issueRE).map!matchToRefs.joiner;
29+
return matchToRefs(message.matchFirst(issueRE));
3030
}
3131

3232
unittest
3333
{
3434
assert(equal(matchIssueRefs("fix issue 16319 and fix std.traits.isInnerClass"), [IssueRef(16319, true)]));
35+
assert(equal(matchIssueRefs("Fixes issues 17494, 17505, 17506"), [IssueRef(17494, true), IssueRef(17505, true), IssueRef(17506, true)]));
36+
// only first match considered, see #175
37+
assert(equal(matchIssueRefs("Fixes Issues 1234 and 2345\nblabla\nFixes Issue 3456"), [IssueRef(1234, true), IssueRef(2345, true)]));
3538
}
3639

3740
struct IssueRef { int id; bool fixed; }

0 commit comments

Comments
 (0)