summaryrefslogtreecommitdiffstats
path: root/modules/git/repo_index.go
diff options
context:
space:
mode:
authorJason Song <i@wolfogre.com>2022-12-27 21:12:49 +0800
committerGitHub <noreply@github.com>2022-12-27 21:12:49 +0800
commit6cf09ccab402fe84a5313e1d3e755e284ebbc845 (patch)
treeb1fad807c2a16fded8b6bda84583c421ec86230c /modules/git/repo_index.go
parent90237d8abd0e6479c1464ac0f32fff6a2ce4a0b4 (diff)
downloadgitea-6cf09ccab402fe84a5313e1d3e755e284ebbc845.tar.gz
gitea-6cf09ccab402fe84a5313e1d3e755e284ebbc845.zip
Use complete SHA to create and query commit status (#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>
Diffstat (limited to 'modules/git/repo_index.go')
-rw-r--r--modules/git/repo_index.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/git/repo_index.go b/modules/git/repo_index.go
index 99eb2b540b..5ff2a2e4fc 100644
--- a/modules/git/repo_index.go
+++ b/modules/git/repo_index.go
@@ -16,7 +16,7 @@ import (
// ReadTreeToIndex reads a treeish to the index
func (repo *Repository) ReadTreeToIndex(treeish string, indexFilename ...string) error {
- if len(treeish) != 40 {
+ if len(treeish) != SHAFullLength {
res, _, err := NewCommand(repo.Ctx, "rev-parse", "--verify").AddDynamicArguments(treeish).RunStdString(&RunOpts{Dir: repo.Path})
if err != nil {
return err