diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-10-18 19:13:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-18 19:13:31 +0800 |
commit | 945f121262ef5a393d9530b62a82b2c141bbe21c (patch) | |
tree | 13d4d91da9a75295ee3455ff183a61c4d3fbb3ad /routers/api/v1/repo/pull.go | |
parent | fecd8f949dedac0751db99dec590ff12ae56818d (diff) | |
download | gitea-945f121262ef5a393d9530b62a82b2c141bbe21c.tar.gz gitea-945f121262ef5a393d9530b62a82b2c141bbe21c.zip |
Fix bug on pull requests when transfer head repository (#8564)
* fix bug on pull requests when transfer head repository
* add migration and fix lint
* fix tests and add a cache check on LoadBaseRepo
Diffstat (limited to 'routers/api/v1/repo/pull.go')
-rw-r--r-- | routers/api/v1/repo/pull.go | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go index 978c8a3f1f..16ddd10c60 100644 --- a/routers/api/v1/repo/pull.go +++ b/routers/api/v1/repo/pull.go @@ -190,7 +190,7 @@ func CreatePullRequest(ctx *context.APIContext, form api.CreatePullRequestOption ) // Get repo/branch information - headUser, headRepo, headGitRepo, compareInfo, baseBranch, headBranch := parseCompareInfo(ctx, form) + _, headRepo, headGitRepo, compareInfo, baseBranch, headBranch := parseCompareInfo(ctx, form) if ctx.Written() { return } @@ -265,15 +265,14 @@ func CreatePullRequest(ctx *context.APIContext, form api.CreatePullRequestOption DeadlineUnix: deadlineUnix, } pr := &models.PullRequest{ - HeadRepoID: headRepo.ID, - BaseRepoID: repo.ID, - HeadUserName: headUser.Name, - HeadBranch: headBranch, - BaseBranch: baseBranch, - HeadRepo: headRepo, - BaseRepo: repo, - MergeBase: compareInfo.MergeBase, - Type: models.PullRequestGitea, + HeadRepoID: headRepo.ID, + BaseRepoID: repo.ID, + HeadBranch: headBranch, + BaseBranch: baseBranch, + HeadRepo: headRepo, + BaseRepo: repo, + MergeBase: compareInfo.MergeBase, + Type: models.PullRequestGitea, } // Get all assignee IDs |