Skip to content

Add branch representation and API calls #15

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

Merged
merged 3 commits into from
Feb 2, 2016
Merged

Conversation

sapk
Copy link
Contributor

@sapk sapk commented Jan 14, 2016

Needed for gogs/gogs#2410

The representation should be near Github API :
https://developer.github.com/v3/repos/#list-branches

@unknwon
Copy link
Member

unknwon commented Jan 15, 2016

Thanks your PR... but Gogs does not provide this info at all currently... which means no use of this APIs.

@sapk
Copy link
Contributor Author

sapk commented Jan 15, 2016

The goal is to add it like https://github.com/gogits/gogs/blob/9cd16c5b12d093dd694e146d6c845ee4c405c774/routers/api/v1/user/keys.go.
Maybe I should do it in 2 step ?

  • Add the representation (structure)
  • Add api call after the api is implemented in gogs

@sapk
Copy link
Contributor Author

sapk commented Jan 15, 2016

I coudl also only return the name attribute for the API response and don't have to rely on API struc representation.

@unknwon
Copy link
Member

unknwon commented Jan 15, 2016

This PR will remain open until server side is implemented :D

package gogs

type Branch struct {
name string `json:"name"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first letter of fields must be upper case.

@sapk
Copy link
Contributor Author

sapk commented Jan 16, 2016

Related wiki page (draft): https://gist.github.com/sapk/df64347ff218baf4a277
the url link is not implemented since there is no API for commit like https://developer.github.com/v3/repos/commits/

unknwon added a commit that referenced this pull request Feb 2, 2016
Add branch representation and API calls
@unknwon unknwon merged commit 01d5b5e into gogs:master Feb 2, 2016
unknwon added a commit that referenced this pull request Feb 2, 2016
@bkcsoft
Copy link
Contributor

bkcsoft commented Feb 5, 2016

@sapk is that really a POST to GET data?

EDIT: More specifically, the wiki-page-draft you linked says POST but the code says GET 😃

@sapk
Copy link
Contributor Author

sapk commented Feb 8, 2016

Sorry bad copy-paste in the draft ^^
Fixed.
@unknown already fix it in the official wiki : https://github.com/gogits/go-gogs-client/wiki/Repositories

guyzmo pushed a commit to guyzmo/go-gogs-client that referenced this pull request May 5, 2017
Reenable linter since it is happy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants