Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-07-01 18:26:30 +0300
committerStan Hu <stanhu@gmail.com>2018-07-01 18:26:30 +0300
commitf4f4e02564dcfa94ebf25e680a1778a5239d150d (patch)
treef5a8da785976ccc00207ee23ab61cd815e80091f /lib/gitlab/bitbucket_server_import
parent5f73bbc61419aacd957eee6b3ddcc8877ce1eb67 (diff)
Add merge commit SHA
Diffstat (limited to 'lib/gitlab/bitbucket_server_import')
-rw-r--r--lib/gitlab/bitbucket_server_import/importer.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/gitlab/bitbucket_server_import/importer.rb b/lib/gitlab/bitbucket_server_import/importer.rb
index 9bc6de2ea5d..84d16074891 100644
--- a/lib/gitlab/bitbucket_server_import/importer.rb
+++ b/lib/gitlab/bitbucket_server_import/importer.rb
@@ -63,7 +63,7 @@ module Gitlab
target_branch_sha = project.repository.commit(target_branch_sha)&.sha || target_branch_sha
project.merge_requests.find_by(iid: pull_request.iid)&.destroy
- merge_request = project.merge_requests.create!(
+ attributes = {
iid: pull_request.iid,
title: pull_request.title,
description: description,
@@ -78,8 +78,10 @@ module Gitlab
assignee_id: nil,
created_at: pull_request.created_at,
updated_at: pull_request.updated_at
- )
+ }
+ attributes[:merge_commit_sha] = target_branch_sha if pull_request.merged?
+ merge_request = project.merge_requests.create!(attributes)
import_pull_request_comments(pull_request, merge_request) if merge_request.persisted?
rescue StandardError => e
errors << { type: :pull_request, iid: pull_request.iid, errors: e.message, trace: e.backtrace.join("\n"), raw_response: pull_request.raw }