Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/entities/diff.rb')
-rw-r--r--lib/api/entities/diff.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/entities/diff.rb b/lib/api/entities/diff.rb
index b9538893d32..cc53736a5b1 100644
--- a/lib/api/entities/diff.rb
+++ b/lib/api/entities/diff.rb
@@ -3,10 +3,12 @@
module API
module Entities
class Diff < Grape::Entity
- expose :json_safe_diff, as: :diff, documentation: {
+ expose :diff, documentation: {
type: 'string',
example: '@@ -71,6 +71,8 @@\n...'
- }
+ } do |instance, options|
+ options[:enable_unidiff] == true ? instance.unidiff : instance.json_safe_diff
+ end
expose :new_path, documentation: { type: 'string', example: 'doc/update/5.4-to-6.0.md' }
expose :old_path, documentation: { type: 'string', example: 'doc/update/5.4-to-6.0.md' }
expose :a_mode, documentation: { type: 'string', example: '100755' }