Commit da88f61b authored by Stan Hu's avatar Stan Hu

Improve formatting of fallback diff note

parent a9d359b4
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment