Use provided cursor for keyset pagination in repository tree
Split from !67509 (comment 659400564)
Discussion Model Tree
contains the cursor to the next page received from Gitaly. It will be preferable to use it rather than implicitly assume that the page token is the last record id. To do that, we would need to somehow expose the cursor in the API response. But it does not work well with the current repository tree response (array of hashes). Should we use headers for that?
If we implement it directly (by guiding users to use the last id in the response as a page token), then we would depend on Gitaly implementation. Changes to page token generation logic will break existing API integrations.
This should be implemented before %15.0 when the legacy pagination system will be removed from this endpoint.
/cc @sean_carroll, @vyaklushin