mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 13:35:50 +01:00
(refs #74)Remove an auxiliary constructor from case class because json4s can't serialize correctly if case class have that.
This commit is contained in:
@@ -142,7 +142,7 @@ trait RepositorySettingsControllerBase extends ControllerBase with FlashMapSuppo
|
|||||||
list.append(new CommitInfo(commit))
|
list.append(new CommitInfo(commit))
|
||||||
}
|
}
|
||||||
|
|
||||||
val payload = new WebHookPayload(
|
val payload = WebHookPayload(
|
||||||
git,
|
git,
|
||||||
"refs/heads/" + repository.repository.defaultBranch,
|
"refs/heads/" + repository.repository.defaultBranch,
|
||||||
repository,
|
repository,
|
||||||
|
|||||||
@@ -74,10 +74,12 @@ object WebHookService {
|
|||||||
case class WebHookPayload(
|
case class WebHookPayload(
|
||||||
ref: String,
|
ref: String,
|
||||||
commits: List[WebHookCommit],
|
commits: List[WebHookCommit],
|
||||||
repository: WebHookRepository){
|
repository: WebHookRepository)
|
||||||
|
|
||||||
def this(git: Git, refName: String, repositoryInfo: RepositoryInfo, commits: List[CommitInfo], repositoryOwner: Account) =
|
object WebHookPayload {
|
||||||
this(
|
def apply(git: Git, refName: String, repositoryInfo: RepositoryInfo,
|
||||||
|
commits: List[CommitInfo], repositoryOwner: Account): WebHookPayload =
|
||||||
|
WebHookPayload(
|
||||||
refName,
|
refName,
|
||||||
commits.map { commit =>
|
commits.map { commit =>
|
||||||
val diffs = JGitUtil.getDiffs(git, commit.id, false)
|
val diffs = JGitUtil.getDiffs(git, commit.id, false)
|
||||||
|
|||||||
@@ -119,7 +119,8 @@ class CommitLogHook(owner: String, repository: String, userName: String, baseURL
|
|||||||
println(getRepository(owner, repository, baseURL).get.url)
|
println(getRepository(owner, repository, baseURL).get.url)
|
||||||
|
|
||||||
// call web hook
|
// call web hook
|
||||||
val payload = new WebHookPayload(git,
|
val payload = WebHookPayload(
|
||||||
|
git,
|
||||||
command.getRefName,
|
command.getRefName,
|
||||||
getRepository(owner, repository, baseURL).get,
|
getRepository(owner, repository, baseURL).get,
|
||||||
newCommits,
|
newCommits,
|
||||||
|
|||||||
Reference in New Issue
Block a user