summaryrefslogtreecommitdiffstats
path: root/vendor/code.gitea.io
diff options
context:
space:
mode:
authorRichard Mahn <richmahn@users.noreply.github.com>2019-02-06 11:19:26 -0700
committerzeripath <art27@cantab.net>2019-02-06 18:19:26 +0000
commitda1edbfb79566e9d31f43ee85eb2e9fc9b52695b (patch)
tree6e81098a8ddb5695b52a6a136bb24286fb8a8c9b /vendor/code.gitea.io
parent0c840a924a9a78556dafdc3e558bdcfe3c704201 (diff)
downloadgitea-da1edbfb79566e9d31f43ee85eb2e9fc9b52695b.tar.gz
gitea-da1edbfb79566e9d31f43ee85eb2e9fc9b52695b.zip
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
Diffstat (limited to 'vendor/code.gitea.io')
-rw-r--r--vendor/code.gitea.io/sdk/gitea/repo_tree.go10
1 files changed, 6 insertions, 4 deletions
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.