From e9bc2c77c35d078c5ba5e6107c3551f31410c936 Mon Sep 17 00:00:00 2001 From: Jason Song Date: Wed, 28 Dec 2022 18:03:21 +0800 Subject: Use complete SHA to create and query commit status (#22244) (#22257) Backport #22244. Fix #13485. Co-authored-by: delvh Co-authored-by: Lauris BH Co-authored-by: Lunny Xiao Co-authored-by: delvh Co-authored-by: Lauris BH Co-authored-by: Lunny Xiao --- modules/context/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/context/api.go') diff --git a/modules/context/api.go b/modules/context/api.go index b9d130e2a8..3eb1de8939 100644 --- a/modules/context/api.go +++ b/modules/context/api.go @@ -388,7 +388,7 @@ func RepoRefForAPI(next http.Handler) http.Handler { return } ctx.Repo.CommitID = ctx.Repo.Commit.ID.String() - } else if len(refName) == 40 { + } else if len(refName) == git.SHAFullLength { ctx.Repo.CommitID = refName ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetCommit(refName) if err != nil { -- cgit v1.2.3