fix list commit api sha param (#2550)

This commit is contained in:
onukura
2020-09-12 14:56:41 +09:00
committed by GitHub
parent 0d20bc0173
commit b35d0792aa

View File

@@ -23,7 +23,7 @@ trait ApiRepositoryCommitControllerBase extends ControllerBase {
val owner = repository.owner
val name = repository.name
// TODO: The following parameters need to be implemented. [:path, :author, :since, :until]
val sha = if (request.body.nonEmpty) (parse(request.body) \ "sha").extract[String] else "refs/heads/master";
val sha = params.getOrElse("sha", "refs/heads/master")
Using.resource(Git.open(getRepositoryDir(owner, name))) {
git =>
val repo = git.getRepository