diff options
author | Stan Hu <stanhu@gmail.com> | 2018-08-01 01:33:08 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-08-01 01:33:08 +0300 |
commit | a9d359b48463c2a77529b9a5f289f9d1abf45484 (patch) | |
tree | 033cf2200a2a9a2788e16a6d463a6135c018b760 /lib | |
parent | 2aa4d7f10fe3f43095b5864cc797b67a84740922 (diff) |
Remove unnecessary lookup for merge request SHAs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/bitbucket_import/importer.rb | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/gitlab/bitbucket_import/importer.rb b/lib/gitlab/bitbucket_import/importer.rb index f3999e690fa..a6514b621f4 100644 --- a/lib/gitlab/bitbucket_import/importer.rb +++ b/lib/gitlab/bitbucket_import/importer.rb @@ -149,21 +149,16 @@ module Gitlab description += @formatter.author_line(pull_request.author) unless find_user_id(pull_request.author) description += pull_request.description - source_branch_sha = pull_request.source_branch_sha - target_branch_sha = pull_request.target_branch_sha - source_branch_sha = project.repository.commit(source_branch_sha)&.sha || source_branch_sha - target_branch_sha = project.repository.commit(target_branch_sha)&.sha || target_branch_sha - merge_request = project.merge_requests.create!( iid: pull_request.iid, title: pull_request.title, description: description, source_project: project, source_branch: pull_request.source_branch_name, - source_branch_sha: source_branch_sha, + source_branch_sha: pull_request.source_branch_sha, target_project: project, target_branch: pull_request.target_branch_name, - target_branch_sha: target_branch_sha, + target_branch_sha: pull_request.target_branch_sha, state: pull_request.state, author_id: gitlab_user_id(project, pull_request.author), assignee_id: nil, |