Skip to content

Commit

Permalink
backport fix: fixed bug in GitTreeBySHA where pulling items from a pa…
Browse files Browse the repository at this point in the history
…ge other than page 1 would fail because the wrong var was used to set the entries to return (#9482)
  • Loading branch information
bhalbright authored and zeripath committed Dec 24, 2019
1 parent a276aaf commit 58c38ab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/repofiles/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 58c38ab

Please sign in to comment.