mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-15 18:05:50 +01:00
Fix response of get single commit API
Fix response of get single commit API
This commit is contained in:
@@ -26,20 +26,12 @@ object ApiCommits {
|
|||||||
committer: ApiPersonIdent,
|
committer: ApiPersonIdent,
|
||||||
message: String,
|
message: String,
|
||||||
comment_count: Int,
|
comment_count: Int,
|
||||||
tree: Tree,
|
tree: Tree
|
||||||
verification: Verification
|
|
||||||
)
|
)
|
||||||
|
|
||||||
case class Tree(
|
case class Tree(
|
||||||
url: ApiPath,
|
url: ApiPath,
|
||||||
tree: String
|
sha: String
|
||||||
)
|
|
||||||
|
|
||||||
case class Verification(
|
|
||||||
verified: Boolean,
|
|
||||||
reason: String //,
|
|
||||||
// signature: String,
|
|
||||||
// payload: String
|
|
||||||
)
|
)
|
||||||
|
|
||||||
case class Stats(
|
case class Stats(
|
||||||
@@ -62,7 +54,6 @@ object ApiCommits {
|
|||||||
|
|
||||||
def apply(repositoryName: RepositoryName, commitInfo: CommitInfo, diffs: Seq[DiffInfo], author: Account, committer: Account,
|
def apply(repositoryName: RepositoryName, commitInfo: CommitInfo, diffs: Seq[DiffInfo], author: Account, committer: Account,
|
||||||
commentCount: Int): ApiCommits = {
|
commentCount: Int): ApiCommits = {
|
||||||
// Is there better way to get diff status?
|
|
||||||
val files = diffs.map { diff =>
|
val files = diffs.map { diff =>
|
||||||
var additions = 0
|
var additions = 0
|
||||||
var deletions = 0
|
var deletions = 0
|
||||||
@@ -111,13 +102,7 @@ object ApiCommits {
|
|||||||
comment_count = commentCount,
|
comment_count = commentCount,
|
||||||
tree = Tree(
|
tree = Tree(
|
||||||
url = ApiPath(s"/api/v3/repos/${repositoryName.fullName}/tree/${commitInfo.id}"), // TODO This endpoint has not been implemented yet.
|
url = ApiPath(s"/api/v3/repos/${repositoryName.fullName}/tree/${commitInfo.id}"), // TODO This endpoint has not been implemented yet.
|
||||||
tree = commitInfo.id
|
sha = commitInfo.id
|
||||||
),
|
|
||||||
verification = Verification( // TODO
|
|
||||||
verified = false,
|
|
||||||
reason = "" //,
|
|
||||||
// signature = "",
|
|
||||||
// payload = ""
|
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
author = ApiUser(author),
|
author = ApiUser(author),
|
||||||
@@ -125,7 +110,7 @@ object ApiCommits {
|
|||||||
parents = commitInfo.parents.map { parent =>
|
parents = commitInfo.parents.map { parent =>
|
||||||
Tree(
|
Tree(
|
||||||
url = ApiPath(s"/api/v3/repos/${repositoryName.fullName}/tree/${parent}"), // TODO This endpoint has not been implemented yet.
|
url = ApiPath(s"/api/v3/repos/${repositoryName.fullName}/tree/${parent}"), // TODO This endpoint has not been implemented yet.
|
||||||
tree = parent
|
sha = parent
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
stats = Stats(
|
stats = Stats(
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ object JsonFormat {
|
|||||||
FieldSerializer[ApiCommits]() +
|
FieldSerializer[ApiCommits]() +
|
||||||
FieldSerializer[ApiCommits.Commit]() +
|
FieldSerializer[ApiCommits.Commit]() +
|
||||||
FieldSerializer[ApiCommits.Tree]() +
|
FieldSerializer[ApiCommits.Tree]() +
|
||||||
FieldSerializer[ApiCommits.Verification]() +
|
|
||||||
FieldSerializer[ApiCommits.Stats]() +
|
FieldSerializer[ApiCommits.Stats]() +
|
||||||
FieldSerializer[ApiCommits.File]() +
|
FieldSerializer[ApiCommits.File]() +
|
||||||
ApiBranchProtection.enforcementLevelSerializer
|
ApiBranchProtection.enforcementLevelSerializer
|
||||||
|
|||||||
Reference in New Issue
Block a user