You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I intend to submit a PR for this issue when I can fix it. This was actually found by an Unfolding Word developer https://github.com/unfoldingWord.
[x]
):2019/12/20 22:25:14 ...les/context/panic.go:35:1() [E] PANIC:: runtime error: index out of range
E:/Go/src/runtime/panic.go:44 (0x42fbc1)
panicindex: panic(indexError)
E:/dev/Go/src/code.gitea.io/gitea/modules/repofiles/tree.go:82 (0x123b1a5)
GetTreeBySHA: tree.Entries[e].Path = entries[e].Name()
E:/dev/Go/src/code.gitea.io/gitea/routers/api/v1/repo/tree.go:59 (0x143d95c)
GetTree: if tree, err := repofiles.GetTreeBySHA(ctx.Repo.Repository, sha, ctx.QueryInt("page"), ctx.QueryInt("per_page"), ctx.QueryBool("recursive")); err != nil {
Description
Issue with paging on /repos/{owner}/{repo}/git/trees/{sha} api, any page other than page 1 that should returns items throws an error 500
Reproduced with super simple repo with only 2 items:
works as expected:
http://localhost:3000/api/v1/repos/balbright2/awesomecode/git/trees/master?recursive=true&per_page=1&page=1
throws error 500:
http://localhost:3000/api/v1/repos/balbright2/awesomecode/git/trees/master?recursive=true&per_page=1&page=2
Log snippet above
...
The text was updated successfully, but these errors were encountered: