mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-06 08:08:37 +02:00
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
This commit is contained in:
1 parent
8f16a2c37b
commit
74179d1b5e
16 files changed
+432
-406
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user