summaryrefslogtreecommitdiff
path: root/lib/gitlab/bitbucket_server_import
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-07-31 15:33:21 -0700
committerStan Hu <stanhu@gmail.com>2018-07-31 15:33:21 -0700
commitda88f61b8221b68add99250e33be88f2903b233e (patch)
tree367833554b76f22f0e7827a873230d59775ff780 /lib/gitlab/bitbucket_server_import
parenta9d359b48463c2a77529b9a5f289f9d1abf45484 (diff)
downloadgitlab-ce-da88f61b8221b68add99250e33be88f2903b233e.tar.gz
Improve formatting of fallback diff note
Diffstat (limited to 'lib/gitlab/bitbucket_server_import')
-rw-r--r--lib/gitlab/bitbucket_server_import/importer.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/gitlab/bitbucket_server_import/importer.rb b/lib/gitlab/bitbucket_server_import/importer.rb
index b7d9b4982c1..69f9cc398c8 100644
--- a/lib/gitlab/bitbucket_server_import/importer.rb
+++ b/lib/gitlab/bitbucket_server_import/importer.rb
@@ -261,8 +261,13 @@ module Gitlab
def create_fallback_diff_note(merge_request, comment, position)
attributes = pull_request_comment_attributes(comment)
- attributes[:note] = "*Comment on #{position.old_path}:#{position.old_line} -> #{position.new_path}:#{position.new_line}*\n\n" + attributes[:note]
+ note = "*Comment on "
+ note += " #{position.old_path}:#{position.old_line} -->" if position.old_line
+ note += " #{position.new_path}:#{position.new_line}" if position.new_line
+ new += "*\n\n#{comment.note}"
+
+ attributes[:note] = note
merge_request.notes.create!(attributes)
end