diff options
author | Stan Hu <stanhu@gmail.com> | 2018-08-01 01:33:21 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-08-01 01:33:21 +0300 |
commit | da88f61b8221b68add99250e33be88f2903b233e (patch) | |
tree | 367833554b76f22f0e7827a873230d59775ff780 /lib/gitlab/bitbucket_server_import | |
parent | a9d359b48463c2a77529b9a5f289f9d1abf45484 (diff) |
Improve formatting of fallback diff note
Diffstat (limited to 'lib/gitlab/bitbucket_server_import')
-rw-r--r-- | lib/gitlab/bitbucket_server_import/importer.rb | 7 |
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 |