Merge branch 'closing-issues-via-commit-messages' of https://github.com/odz/gitbucket into odz-closing-issues-via-commit-messages

This commit is contained in:
takezoe
2014-03-02 04:02:45 +09:00
3 changed files with 32 additions and 0 deletions

View File

@@ -141,6 +141,14 @@ class CommitLogHook(owner: String, repository: String, pusher: String, baseUrl:
}
}
// close issues
val defaultBranch = getRepository(owner, repository, baseURL).get.repository.defaultBranch
if(refName(1) == "heads" && branchName == defaultBranch && command.getType == ReceiveCommand.Type.UPDATE){
git.log.addRange(command.getOldId, command.getNewId).call.asScala.foreach { commit =>
closeIssuesFromMessage(commit.getFullMessage, pusher, owner, repository)
}
}
// call web hook
getWebHookURLs(owner, repository) match {
case webHookURLs if(webHookURLs.nonEmpty) =>