summaryrefslogtreecommitdiffstats
path: root/services/repository/files/tree.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 /services/repository/files/tree.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 'services/repository/files/tree.go')
-rw-r--r--services/repository/files/tree.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/repository/files/tree.go b/services/repository/files/tree.go
index 59e5690977..513b8a2274 100644
--- a/services/repository/files/tree.go
+++ b/services/repository/files/tree.go
@@ -50,7 +50,7 @@ func GetTreeBySHA(ctx context.Context, repo *repo_model.Repository, gitRepo *git
copy(treeURL[apiURLLen:], "/git/trees/")
// 40 is the size of the sha1 hash in hexadecimal format.
- copyPos := len(treeURL) - 40
+ copyPos := len(treeURL) - git.SHAFullLength
if perPage <= 0 || perPage > setting.API.DefaultGitTreesPerPage {
perPage = setting.API.DefaultGitTreesPerPage