-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Git-Trees API. #4185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Git-Trees API. #4185
Conversation
Done. I used the types from go-gitea/go-sdk#109 however, i can change it to the types used in go-gitea/go-sdk#94 if required. |
@Kasi-R would it be possible to use other PR in SDK? I think it would be best to merge in functionality then another PR for enhancement. |
@lafriks please update review. Can you also review go-gitea/go-sdk#94? |
routers/api/v1/api.go
Outdated
m.Group("/:username/:reponame", func() { | ||
m.Combo("").Get(repo.Get).Delete(reqToken(), repo.Delete) | ||
m.Group("/trees", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should probably use github compatible route (/git/trees
)
@techknowlogick done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of small requests for better explanation of where some constants are coming from -- otherwise this looks good, very straightforward -- certainly simpler than my attempt #1978 !
routers/api/v1/repo/tree.go
Outdated
return tree | ||
} | ||
RepoIDLen := len(RepoID) | ||
BlobURL := make([]byte, RepoIDLen + 47) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kasi-R could you please add a comment or variable describing where the magic number 47
comes from?
routers/api/v1/repo/tree.go
Outdated
BlobURL := make([]byte, RepoIDLen + 47) | ||
copy(BlobURL[:], RepoID) | ||
copy(BlobURL[RepoIDLen:], "/blobs/") | ||
TreeURL := make([]byte, RepoIDLen + 47) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above -- same here please.
TreeURL := make([]byte, RepoIDLen + 47) | ||
copy(TreeURL[:], RepoID) | ||
copy(TreeURL[RepoIDLen:], "/trees/") | ||
CopyPos := len(TreeURL) - 40 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar request here -- where is the 40
coming from?
* Make sure author cannot reject/approve their own PR * Disable buttons in templates too * Remove unneccessary if check since the switch below catches it * Fix IsOwner check * Update template and remove new template variable * Add alert template and redirect to diff page on review failure * Redirect to files diff as a little update to #4632
…ttached to the team (#4719)
* Make sure to reset commit count in the cache on mirror syncing * reset count of commits in all branches
* Update dep github.com/markbates/goth * Update dep github.com/blevesearch/bleve * Update dep golang.org/x/oauth2 * Fix github.com/blevesearch/bleve to c74e08f039e56cef576e4336382b2a2d12d9e026 * Update dep golang.org/x/oauth2
* implement email domain whitelist
Signed-off-by: Lucien Kerl <lucien.kerl@wuerth-it.com>
* Remove field from migration to support upgrades from older version That will ensure the field does not get queried in the Select if it does not exist yet: ``` [I] [SQL] SELECT "id", "repo_id", "index", "poster_id", "name", "content", "milestone_id", "priority", "assignee_id", "is_closed", "is_pull", "num_comments", "ref", "deadline_unix", "created_unix", "updated_unix [...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: pq: column "ref" does not exist ``` see #5318 * Skip remove stale watcher migration if not required Otherwise the migration will fail if executed from a older database version without multiple IssueWatch feature. ``` 2018/11/11 23:51:14 [I] [SQL] SELECT DISTINCT "issue_watch"."user_id", "issue"."repo_id" FROM "issue_watch" INNER JOIN issue ON issue_watch.issue_id = issue.id WHERE (issue_watch.is_watching = $1) LIMIT 50 []int [...itea/routers/init.go:60 GlobalInit()] [E] Failed to initialize ORM engine: migrate: do migrate: pq: relation "issue_watch" does not exist ``` see #5318
* Add raw blob endpoint This should make it possible to download raw blobs directly from /:repo/:username/raw/blob/:sha1 URLs. * fix: Make it work * As an SHA-ID is no path getRefNameFromPath can't be used to verify file specifying parameter * added relevant change in go-gitea/git #132 Signed-off-by: Berengar W. Lehr <Berengar.Lehr@kompetenztest.de> * Update Gopkg.lock Can't update all vendors due to errors Signed-off-by: Berengar W. Lehr <Berengar.Lehr@kompetenztest.de> * style: Add Gitea copyright header * feat: Added integration test for /repo/u/r/raw/blob * fix: correct year in copyright header
* add api for user to create org * remove unused blank line on the swagger file end * fix create and add test * fix tests * fix routes of create org API * fix bug * add copyright heads
* #3758: [doc] file rendering through external binaries * fix subsections markup * include proposed changes from PR review
…ount via cli (#5391) * don't force a password change for the admin user * don't totally dicard -must-change-password flag if creating the first (admin) user via the cli. Use flag if present but make sure to default to not forcing a password update
* Notes on upgrading docker installation Basis from [gogs/gogs](https://github.com/gogs/gogs/blob/master/docker/README.md) * Feedback from @sapk to use docker-compose only
Started on Git-Trees API. Added methods for getting a tree and getting a tree recursively as per https://developer.github.com/v3/git/trees/
Creating a tree not done.