From 58c38ab4b6a7031ad8261dfd8af67d2bbab9b41b Mon Sep 17 00:00:00 2001 From: Brad Albright <32200834+bhalbright@users.noreply.github.com> Date: Tue, 24 Dec 2019 01:01:02 -0600 Subject: [PATCH] backport fix: fixed bug in GitTreeBySHA where pulling items from a page other than page 1 would fail because the wrong var was used to set the entries to return (#9482) --- modules/repofiles/tree.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/repofiles/tree.go b/modules/repofiles/tree.go index cf0534563..b3edea341 100644 --- a/modules/repofiles/tree.go +++ b/modules/repofiles/tree.go @@ -79,11 +79,11 @@ func GetTreeBySHA(repo *models.Repository, sha string, page, perPage int, recurs for e := rangeStart; e < rangeEnd; e++ { i := e - rangeStart - tree.Entries[e].Path = entries[e].Name() - tree.Entries[e].Mode = fmt.Sprintf("%06o", entries[e].Mode()) - tree.Entries[e].Type = entries[e].Type() - tree.Entries[e].Size = entries[e].Size() - tree.Entries[e].SHA = entries[e].ID.String() + tree.Entries[i].Path = entries[e].Name() + tree.Entries[i].Mode = fmt.Sprintf("%06o", entries[e].Mode()) + tree.Entries[i].Type = entries[e].Type() + tree.Entries[i].Size = entries[e].Size() + tree.Entries[i].SHA = entries[e].ID.String() if entries[e].IsDir() { copy(treeURL[copyPos:], entries[e].ID.String())