-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Implement git refs API for listing references (branches, tags and other) #5354
Conversation
@lafriks please update vendored files, and resolve conflict. |
75ce611
to
85d595b
Compare
Codecov Report
@@ Coverage Diff @@
## master #5354 +/- ##
==========================================
+ Coverage 37.46% 37.57% +0.11%
==========================================
Files 312 313 +1
Lines 46522 46617 +95
==========================================
+ Hits 17428 17515 +87
- Misses 26601 26607 +6
- Partials 2493 2495 +2
Continue to review full report at Codecov.
|
Ready for review |
SHA: refs[i].Object.String(), | ||
Type: refs[i].Type, | ||
// TODO: Add commit/tag info URL | ||
//URL: ctx.Repo.Repository.APIURL() + "/git/" + refs[i].Type + "s/" + refs[i].Object.String(), |
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.
Not finished?
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.
That is for next pull request where I will implement getting tags details in route /git/tags
@@ -573,6 +573,10 @@ func RegisterRoutes(m *macaron.Macaron) { | |||
m.Get("/status", repo.GetCombinedCommitStatusByRef) | |||
m.Get("/statuses", repo.GetCommitStatusesByRef) | |||
}) | |||
m.Group("/git", 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.
permission check?
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.
what exact permission check are you talking about. (It is checked for access read only rights for repo). Do you mean unit type check?
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.
Didn't find the access read check. Unit type check should be fixed by my PR #5314 .
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.
It is already checked in upper group in function repoAssignment
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.
Right. It's different from the middleware which has the same name and used by ui routers.
@lunny ? :) |
@lunny so is there anything I need to fix this PR? |
Implements git refs API
/repos/{owner}/{repo}/git/refs/{ref}
. Implements onlyGET
methods fully compatible with GitHub APIPartly fixes #2738
Depends on go-gitea/go-sdk#129
TODO: