summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-12-13 22:21:06 +0000
committerAntoine GIRARD <sapk@users.noreply.github.com>2019-12-13 23:21:06 +0100
commit74179d1b5e739b3fa0d0915bb35d6b7596fd13af (patch)
treefd8eb776c254b716a4e2d416bb6903f1c4c90ea7 /routers/api/v1/repo
parent8f16a2c37b4f2650f5e9623a92eb368db9564c6f (diff)
downloadgitea-74179d1b5e739b3fa0d0915bb35d6b7596fd13af.tar.gz
gitea-74179d1b5e739b3fa0d0915bb35d6b7596fd13af.zip
Remove SavePatch and generate patches on the fly (#9302)
* Save patches to temporary files * Remove SavePatch and generate patches on the fly * Use ioutil.TempDir * fixup! Use ioutil.TempDir * fixup! fixup! Use ioutil.TempDir * RemoveAll LocalCopyPath() in initIntergrationTest * Default to status checking on PR creation * Remove unnecessary set to StatusChecking * Protect against unable to load repo * Handle conflicts * Restore original conflict setting * In TestPullRequests update status to StatusChecking before running TestPatch
Diffstat (limited to 'routers/api/v1/repo')
-rw-r--r--routers/api/v1/repo/pull.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go
index 9abcaa0496..93fa6ad276 100644
--- a/routers/api/v1/repo/pull.go
+++ b/routers/api/v1/repo/pull.go
@@ -244,12 +244,6 @@ func CreatePullRequest(ctx *context.APIContext, form api.CreatePullRequestOption
milestoneID = milestone.ID
}
- patch, err := headGitRepo.GetPatch(compareInfo.MergeBase, headBranch)
- if err != nil {
- ctx.Error(500, "GetPatch", err)
- return
- }
-
var deadlineUnix timeutil.TimeStamp
if form.Deadline != nil {
deadlineUnix = timeutil.TimeStamp(form.Deadline.Unix())
@@ -306,7 +300,7 @@ func CreatePullRequest(ctx *context.APIContext, form api.CreatePullRequestOption
}
}
- if err := pull_service.NewPullRequest(repo, prIssue, labelIDs, []string{}, pr, patch, assigneeIDs); err != nil {
+ if err := pull_service.NewPullRequest(repo, prIssue, labelIDs, []string{}, pr, assigneeIDs); err != nil {
if models.IsErrUserDoesNotHaveAccessToRepo(err) {
ctx.Error(400, "UserDoesNotHaveAccessToRepo", err)
return