diff options
author | James Moger <james.moger@gitblit.com> | 2014-03-28 19:58:48 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-03-28 20:06:00 -0400 |
commit | ee4ef4efef65c834f722381c012928df602ceff3 (patch) | |
tree | aa726e121b170c7975151e94572cae6ce4229e30 | |
parent | 53a83f67aef203379e43a9ed89ccfcb16c16200e (diff) | |
download | gitblit-ee4ef4efef65c834f722381c012928df602ceff3.tar.gz gitblit-ee4ef4efef65c834f722381c012928df602ceff3.zip |
Fix close ticket on push by commit message parsing (issue-404)
-rw-r--r-- | releases.moxie | 1 | ||||
-rw-r--r-- | src/main/java/com/gitblit/git/PatchsetReceivePack.java | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/releases.moxie b/releases.moxie index 0c5299e5..6227ce5b 100644 --- a/releases.moxie +++ b/releases.moxie @@ -11,6 +11,7 @@ r22: { security: ~ fixes: - Repository mailing lists could not be reset from the Edit Repository page (issue-399) + - Fix closing ticket on push by parsing commit messages for closes|fixes (issue-404) - Ensure the Lucene ticket index is updated on repository deletion. changes: - Option to allow LDAP users to directly authenticate without performing LDAP searches (pr-162)) diff --git a/src/main/java/com/gitblit/git/PatchsetReceivePack.java b/src/main/java/com/gitblit/git/PatchsetReceivePack.java index 3ec3086a..1d3312aa 100644 --- a/src/main/java/com/gitblit/git/PatchsetReceivePack.java +++ b/src/main/java/com/gitblit/git/PatchsetReceivePack.java @@ -775,6 +775,9 @@ public class PatchsetReceivePack extends GitblitReceivePack { }
TicketModel ticket = ticketService.getTicket(repository, ticketNumber);
+ if (ticket == null) {
+ continue;
+ }
String integrationBranch;
if (StringUtils.isEmpty(ticket.mergeTo)) {
// unspecified integration branch
@@ -897,7 +900,7 @@ public class PatchsetReceivePack extends GitblitReceivePack { Pattern p = Pattern.compile("(?:fixes|closes)[\\s-]+#?(\\d+)", Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher(commit.getFullMessage());
while (m.find()) {
- String val = m.group();
+ String val = m.group(1);
return Long.parseLong(val);
}
}
|