diff options
author | Sean McGivern <sean@gitlab.com> | 2016-10-13 12:34:15 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-10-13 22:16:35 +0300 |
commit | 3764fd4b4166bdf869cc04e4e82558d6b80b4ca5 (patch) | |
tree | 4fb9c02aecfc3409d70cd45c6525aaabe4035acc /lib/gitlab/conflict | |
parent | cdd0dd507d1d5a226f1f438c4bfa602a115caac3 (diff) |
Add blob_ace_mode to conflict content response
Diffstat (limited to 'lib/gitlab/conflict')
-rw-r--r-- | lib/gitlab/conflict/file.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/gitlab/conflict/file.rb b/lib/gitlab/conflict/file.rb index 661e43d3fa9..c843315782d 100644 --- a/lib/gitlab/conflict/file.rb +++ b/lib/gitlab/conflict/file.rb @@ -25,6 +25,10 @@ module Gitlab merge_file_result[:data] end + def our_blob + @our_blob ||= repository.blob_at(merge_request.diff_refs.head_sha, our_path) + end + def type lines unless @type @@ -209,6 +213,7 @@ module Gitlab json_hash.tap do |json_hash| if opts[:full_content] json_hash[:content] = content + json_hash[:blob_ace_mode] = our_blob && our_blob.language.try(:ace_mode) else json_hash[:sections] = sections if type.text? json_hash[:type] = type |