summaryrefslogtreecommitdiff
path: root/lib/gitlab/bitbucket_server_import
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-07-31 14:30:01 -0700
committerStan Hu <stanhu@gmail.com>2018-07-31 14:30:01 -0700
commit2aa4d7f10fe3f43095b5864cc797b67a84740922 (patch)
tree69a557a2e10c6fe185222d41effcfdab523e60c8 /lib/gitlab/bitbucket_server_import
parent0b91a53302b4800a626fe4c930e08eebaa34b3da (diff)
downloadgitlab-ce-2aa4d7f10fe3f43095b5864cc797b67a84740922.tar.gz
Fix bug where fallback diff notes would not have an associated position
Diffstat (limited to 'lib/gitlab/bitbucket_server_import')
-rw-r--r--lib/gitlab/bitbucket_server_import/importer.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/bitbucket_server_import/importer.rb b/lib/gitlab/bitbucket_server_import/importer.rb
index a10cd860639..b7d9b4982c1 100644
--- a/lib/gitlab/bitbucket_server_import/importer.rb
+++ b/lib/gitlab/bitbucket_server_import/importer.rb
@@ -253,15 +253,15 @@ module Gitlab
# 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)
+ create_fallback_diff_note(merge_request, comment, position)
rescue StandardError => e
errors << { type: :pull_request, id: comment.id, errors: e.message }
nil
end
- def create_fallback_diff_note(merge_request, comment)
+ def create_fallback_diff_note(merge_request, comment, position)
attributes = pull_request_comment_attributes(comment)
- attributes[:note] = "*Comment on file: #{comment.file_path}, old line: #{comment.old_pos}, new line: #{comment.new_pos}*\n\n" + attributes[:note]
+ attributes[:note] = "*Comment on #{position.old_path}:#{position.old_line} -> #{position.new_path}:#{position.new_line}*\n\n" + attributes[:note]
merge_request.notes.create!(attributes)
end