diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-19 15:57:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-19 15:57:54 +0300 |
commit | 419c53ec62de6e97a517abd5fdd4cbde3a942a34 (patch) | |
tree | 1f43a548b46bca8a5fb8fe0c31cef1883d49c5b6 /lib/api/entities/diff.rb | |
parent | 1da20d9135b3ad9e75e65b028bffc921aaf8deb7 (diff) |
Add latest changes from gitlab-org/gitlab@16-5-stable-eev16.5.0-rc42
Diffstat (limited to 'lib/api/entities/diff.rb')
-rw-r--r-- | lib/api/entities/diff.rb | 6 |
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' } |