From da1edbfb79566e9d31f43ee85eb2e9fc9b52695b Mon Sep 17 00:00:00 2001 From: Richard Mahn Date: Wed, 6 Feb 2019 11:19:26 -0700 Subject: Feature - Pagination for git tree API (#5838) * Feature - Pagination for git tree API * Handles case when page is negative * Does a for loop over the start and end rather than all entries * Removed redundent logic * Adds per_page as a query parameter * Adds DEFAULT_GIT_TREES_PER_PAGE for settings, ran make fmt * Fix typo in cheat-sheet en * Makes page start at 1, generated swagger * Use updates to SDK * Updates to use latest sdk * Updates swagger for tree api * Adds test for GetTreeBySHA * Updates per PR reviews * Updates per PR reviews * Remove file * Formatting * Fix to swagger file * Fix to swagger * Update v1_json.tmpl * Fix to swagger file --- vendor/code.gitea.io/sdk/gitea/repo_tree.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'vendor/code.gitea.io') diff --git a/vendor/code.gitea.io/sdk/gitea/repo_tree.go b/vendor/code.gitea.io/sdk/gitea/repo_tree.go index cef3c64673..842ab9b438 100644 --- a/vendor/code.gitea.io/sdk/gitea/repo_tree.go +++ b/vendor/code.gitea.io/sdk/gitea/repo_tree.go @@ -20,10 +20,12 @@ type GitEntry struct { // GitTreeResponse returns a git tree type GitTreeResponse struct { - SHA string `json:"sha"` - URL string `json:"url"` - Entries []GitEntry `json:"tree"` - Truncated bool `json:"truncated"` + SHA string `json:"sha"` + URL string `json:"url"` + Entries []GitEntry `json:"tree"` + Truncated bool `json:"truncated"` + Page int `json:"page"` + TotalCount int `json:"total_count"` } // GetTrees downloads a file of repository, ref can be branch/tag/commit. -- cgit v1.2.3