summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad Albright <32200834+bhalbright@users.noreply.github.com>2019-12-21 18:16:21 -0600
committerzeripath <art27@cantab.net>2019-12-22 00:16:21 +0000
commit875d6b2f8e52a362e47118393bcd47026852db8c (patch)
tree0aee7505a02a7946d1b6b4517747cfd360183cbb
parent8149ed70405224250256757ba39e4d84674e5937 (diff)
downloadgitea-875d6b2f8e52a362e47118393bcd47026852db8c.tar.gz
gitea-875d6b2f8e52a362e47118393bcd47026852db8c.zip
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 (#9459)
-rw-r--r--modules/repofiles/tree.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/repofiles/tree.go b/modules/repofiles/tree.go
index cf0534563f..b3edea341f 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())