summaryrefslogtreecommitdiff
path: root/lib/gitlab/bitbucket_server_import
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-07-17 15:58:12 -0700
committerStan Hu <stanhu@gmail.com>2018-07-17 15:58:12 -0700
commitbb0603935d33f532d65547161aaf9d1823acaff3 (patch)
treee1fa25632c2317bcb07f0f31ae55d5021c5b12b5 /lib/gitlab/bitbucket_server_import
parentc16cbed9401b09235cf4febca3f72e704ad8e9ae (diff)
downloadgitlab-ce-bb0603935d33f532d65547161aaf9d1823acaff3.tar.gz
Some formatting cleanup
Diffstat (limited to 'lib/gitlab/bitbucket_server_import')
-rw-r--r--lib/gitlab/bitbucket_server_import/importer.rb11
-rw-r--r--lib/gitlab/bitbucket_server_import/project_creator.rb3
2 files changed, 5 insertions, 9 deletions
diff --git a/lib/gitlab/bitbucket_server_import/importer.rb b/lib/gitlab/bitbucket_server_import/importer.rb
index 133b8f763ec..93fa7a0f4d4 100644
--- a/lib/gitlab/bitbucket_server_import/importer.rb
+++ b/lib/gitlab/bitbucket_server_import/importer.rb
@@ -230,9 +230,7 @@ module Gitlab
def create_diff_note(merge_request, comment, position, discussion_id = nil)
attributes = pull_request_comment_attributes(comment)
- attributes.merge!(
- position: position,
- type: 'DiffNote')
+ attributes.merge!(position: position, type: 'DiffNote')
attributes[:discussion_id] = discussion_id if discussion_id
note = merge_request.notes.build(attributes)
@@ -242,16 +240,15 @@ module Gitlab
return note
end
- # Fallback to a regular comment
+ # Bitbucket Server supports the ability to comment on any line, not just the
+ # line in the diff. If we can't add the note as a DiffNote, fallback to creating
+ # a regular note.
create_fallback_diff_note(merge_request, comment)
rescue StandardError => e
errors << { type: :pull_request, id: comment.id, errors: e.message }
nil
end
- # Bitbucket Server supports the ability to comment on any line, not just the
- # line in the diff. If we can't add the note as a DiffNote, fallback to creating
- # a regular note.
def create_fallback_diff_note(merge_request, comment)
attributes = pull_request_comment_attributes(comment)
attributes[:note] = "Comment on file: #{comment.file_path}, old position: #{comment.old_pos}, new_position: #{comment.new_pos}\n\n" + attributes[:note]
diff --git a/lib/gitlab/bitbucket_server_import/project_creator.rb b/lib/gitlab/bitbucket_server_import/project_creator.rb
index 49b81b24856..35e8cd7e0ab 100644
--- a/lib/gitlab/bitbucket_server_import/project_creator.rb
+++ b/lib/gitlab/bitbucket_server_import/project_creator.rb
@@ -26,8 +26,7 @@ module Gitlab
import_url: repo.clone_url,
import_data: {
credentials: session_data,
- data: { project_key: project_key,
- repo_slug: repo_slug }
+ data: { project_key: project_key, repo_slug: repo_slug }
},
skip_wiki: true
).execute