Get commits of a pull request #10918#12118
Get commits of a pull request #10918#12118AndrewBezold wants to merge 11 commits intogo-gitea:masterfrom
Conversation
routers/api/v1/repo/pull.go
Outdated
| ctx.InternalServerError(err) | ||
| return | ||
| } | ||
| if err := pr.LoadHeadRepo(); err != nil { |
There was a problem hiding this comment.
In fact, head repository may missed, but we should still allow to get the pull request commits.
There was a problem hiding this comment.
You're correct, and in fact headRepo isn't used from what I can see. Removing that section.
| apiCommits := make([]*api.Commit, commits.Len()) | ||
|
|
||
| i := 0 | ||
| for commitPointer := commits.Front(); commitPointer != nil; commitPointer = commitPointer.Next() { |
|
|
api_issue_test.go:156: Error: should have 9 item(s), but has 10 |
|
Why not use existing test repos? |
| assert.NoError(t, pullIssue.LoadIssue()) | ||
| repo := models.AssertExistsAndLoadBean(t, &models.Repository{ID: pullIssue.HeadRepoID}).(*models.Repository) | ||
|
|
||
| // test ListPullReviews |
|
@AndrewBezold I think you should just use the existing testdata |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions. |
|
This pull request has been automatically closed because of inactivity. You can re-open it if needed. |
Add an API endpoint to get commits of a pull request, similar to Github's.
Proposed endpoint is
GET /repos/{owner}/{repo}/pulls/{index}/commitsFix #10918