mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 21:45: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))
|
||||
}
|
||||
|
||||
val payload = new WebHookPayload(
|
||||
val payload = WebHookPayload(
|
||||
git,
|
||||
"refs/heads/" + repository.repository.defaultBranch,
|
||||
repository,
|
||||
|
||||
@@ -74,10 +74,12 @@ object WebHookService {
|
||||
case class WebHookPayload(
|
||||
ref: String,
|
||||
commits: List[WebHookCommit],
|
||||
repository: WebHookRepository){
|
||||
repository: WebHookRepository)
|
||||
|
||||
def this(git: Git, refName: String, repositoryInfo: RepositoryInfo, commits: List[CommitInfo], repositoryOwner: Account) =
|
||||
this(
|
||||
object WebHookPayload {
|
||||
def apply(git: Git, refName: String, repositoryInfo: RepositoryInfo,
|
||||
commits: List[CommitInfo], repositoryOwner: Account): WebHookPayload =
|
||||
WebHookPayload(
|
||||
refName,
|
||||
commits.map { commit =>
|
||||
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)
|
||||
|
||||
// call web hook
|
||||
val payload = new WebHookPayload(git,
|
||||
val payload = WebHookPayload(
|
||||
git,
|
||||
command.getRefName,
|
||||
getRepository(owner, repository, baseURL).get,
|
||||
newCommits,
|
||||
|
||||
Reference in New Issue
Block a user