aboutsummaryrefslogtreecommitdiffstats
path: root/services/repository/files/tree.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-10-08 01:20:53 +0800
committerGitHub <noreply@github.com>2022-10-08 01:20:53 +0800
commitc08e42c47ef2a32b3b7ee422c73d6929c93b199e (patch)
tree7425d3fa27e7ac65de4f251ed22db1511b21adc4 /services/repository/files/tree.go
parent69fc510d6dcf9cda7993eae8cd5c7725b345a9a1 (diff)
downloadgitea-c08e42c47ef2a32b3b7ee422c73d6929c93b199e.tar.gz
gitea-c08e42c47ef2a32b3b7ee422c73d6929c93b199e.zip
Refactor parseTreeEntries, speed up tree list (#21368)
Close #20315 (fix the panic when parsing invalid input), Speed up #20231 (use ls-tree without size field) Introduce ListEntriesRecursiveFast (ls-tree without size) and ListEntriesRecursiveWithSize (ls-tree with size)
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 caad732887..59e5690977 100644
--- a/services/repository/files/tree.go
+++ b/services/repository/files/tree.go
@@ -29,7 +29,7 @@ func GetTreeBySHA(ctx context.Context, repo *repo_model.Repository, gitRepo *git
tree.URL = repo.APIURL() + "/git/trees/" + url.PathEscape(tree.SHA)
var entries git.Entries
if recursive {
- entries, err = gitTree.ListEntriesRecursive()
+ entries, err = gitTree.ListEntriesRecursiveWithSize()
} else {
entries, err = gitTree.ListEntries()
}