summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/status.go
diff options
context:
space:
mode:
authorJason Song <i@wolfogre.com>2022-12-28 18:03:21 +0800
committerGitHub <noreply@github.com>2022-12-28 11:03:21 +0100
commite9bc2c77c35d078c5ba5e6107c3551f31410c936 (patch)
tree8c0b771a9efe60101fd5520db7403ed9c59e2f31 /routers/api/v1/repo/status.go
parent9b4da56963692819d236b07504e565d4b4fb4021 (diff)
downloadgitea-e9bc2c77c35d078c5ba5e6107c3551f31410c936.tar.gz
gitea-e9bc2c77c35d078c5ba5e6107c3551f31410c936.zip
Use complete SHA to create and query commit status (#22244) (#22257)
Backport #22244. Fix #13485. Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'routers/api/v1/repo/status.go')
-rw-r--r--routers/api/v1/repo/status.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/routers/api/v1/repo/status.go b/routers/api/v1/repo/status.go
index 97ef69a6ea..7bc0edeadc 100644
--- a/routers/api/v1/repo/status.go
+++ b/routers/api/v1/repo/status.go
@@ -184,6 +184,7 @@ func getCommitStatuses(ctx *context.APIContext, sha string) {
ctx.Error(http.StatusBadRequest, "ref/sha not given", nil)
return
}
+ sha = utils.MustConvertToSHA1(ctx.Context, sha)
repo := ctx.Repo.Repository
listOptions := utils.GetListOptions(ctx)