|
|
@ -325,11 +325,11 @@ func DownloadCommitDiffOrPatch(ctx *context.APIContext) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// GetCommitPullRequest returns the pull request of the commit
|
|
|
|
// GetCommitPullRequest returns the merged pull request of the commit
|
|
|
|
func GetCommitPullRequest(ctx *context.APIContext) {
|
|
|
|
func GetCommitPullRequest(ctx *context.APIContext) {
|
|
|
|
// swagger:operation GET /repos/{owner}/{repo}/commits/{sha}/pull repository repoGetCommitPullRequest
|
|
|
|
// swagger:operation GET /repos/{owner}/{repo}/commits/{sha}/pull repository repoGetCommitPullRequest
|
|
|
|
// ---
|
|
|
|
// ---
|
|
|
|
// summary: Get the pull request of the commit
|
|
|
|
// summary: Get the merged pull request of the commit
|
|
|
|
// produces:
|
|
|
|
// produces:
|
|
|
|
// - application/json
|
|
|
|
// - application/json
|
|
|
|
// parameters:
|
|
|
|
// parameters:
|
|
|
@ -354,7 +354,7 @@ func GetCommitPullRequest(ctx *context.APIContext) {
|
|
|
|
// "404":
|
|
|
|
// "404":
|
|
|
|
// "$ref": "#/responses/notFound"
|
|
|
|
// "$ref": "#/responses/notFound"
|
|
|
|
|
|
|
|
|
|
|
|
pr, err := issues_model.GetPullRequestByMergedCommit(ctx, ctx.Repo.Repository.ID, ctx.PathParam(":sha"))
|
|
|
|
pr, err := issues_model.GetPullRequestByMergedCommit(ctx, ctx.Repo.Repository.ID, ctx.PathParam("sha"))
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
if issues_model.IsErrPullRequestNotExist(err) {
|
|
|
|
if issues_model.IsErrPullRequestNotExist(err) {
|
|
|
|
ctx.Error(http.StatusNotFound, "GetPullRequestByMergedCommit", err)
|
|
|
|
ctx.Error(http.StatusNotFound, "GetPullRequestByMergedCommit", err)
|
|
|
|