Skip to content

Commit 4e44439

Browse files
committed
dlangbot.bugzilla: Allow matching "Fix issue..." at the start of a line
Allow placing the line later in the commit body, instead of requiring it to be at the start of the commit summary.
1 parent 3f3d147 commit 4e44439

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

source/dlangbot/bugzilla.d

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ auto matchIssueRefs(string message)
2727
}
2828

2929
enum issueRE = ctRegex!(`(?:^fix(?:es)?(?:\s+(?:issues?|bugs?))?\s+(#?\d+(?:[\s,\+&and]+#?\d+)*))|` ~
30-
`(?:(?:issues?|bugs?)\s+(#?\d+(?:[\s,\+&and]+#?\d+)*))`, "i");
30+
`(?:(?:issues?|bugs?)\s+(#?\d+(?:[\s,\+&and]+#?\d+)*))`, "im");
3131
return matchToRefs(message.matchFirst(issueRE));
3232
}
3333

@@ -39,6 +39,9 @@ unittest
3939
[IssueRef(17494, true),IssueRef(17505, true), IssueRef(17506, true)]));
4040
assert(equal(matchIssueRefs("Fix issues 42, 55, 98: Baguette poisson fraise"),
4141
[ IssueRef(42, true), IssueRef(55, true), IssueRef(98, true) ]));
42+
// Multi-line
43+
assert(equal(matchIssueRefs("Bla bla bla\n\nFixes issue #123"),
44+
[IssueRef(123, true)]));
4245
// only first match considered, see #175
4346
assert(equal(matchIssueRefs("Fixes Issues 1234 and 2345\nblabla\nFixes Issue 3456"),
4447
[IssueRef(1234, true), IssueRef(2345, true)]));

0 commit comments

Comments
 (0)