diff options
author | Jason Song <i@wolfogre.com> | 2022-12-28 18:03:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-28 11:03:21 +0100 |
commit | e9bc2c77c35d078c5ba5e6107c3551f31410c936 (patch) | |
tree | 8c0b771a9efe60101fd5520db7403ed9c59e2f31 /modules/context/api.go | |
parent | 9b4da56963692819d236b07504e565d4b4fb4021 (diff) | |
download | gitea-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 'modules/context/api.go')
-rw-r--r-- | modules/context/api.go | 2 |
1 files changed, 1 insertions, 1 deletions
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 { |