diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2022-10-08 01:20:53 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-08 01:20:53 +0800 |
commit | c08e42c47ef2a32b3b7ee422c73d6929c93b199e (patch) | |
tree | 7425d3fa27e7ac65de4f251ed22db1511b21adc4 /services/repository/files/tree.go | |
parent | 69fc510d6dcf9cda7993eae8cd5c7725b345a9a1 (diff) | |
download | gitea-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.go | 2 |
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() } |