diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-07-27 19:00:34 +0200 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-08-03 07:00:20 +0200 |
commit | c86c1905b5574cac234315598d8d715fcaee3ea7 (patch) | |
tree | 31ba7ab51c04b07ea70d15db88f2370f9ca6359e /lib/api | |
parent | 1d0c7b74920a94e488e6a2c090abb3e525438053 (diff) | |
download | gitlab-ce-c86c1905b5574cac234315598d8d715fcaee3ea7.tar.gz |
switch from diff_file_collection to diffs20034-safe-diffs
So we have raw_diffs too
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/commits.rb | 4 | ||||
-rw-r--r-- | lib/api/entities.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/commits.rb b/lib/api/commits.rb index 4a11c8e3620..b4eaf1813d4 100644 --- a/lib/api/commits.rb +++ b/lib/api/commits.rb @@ -54,7 +54,7 @@ module API sha = params[:sha] commit = user_project.commit(sha) not_found! "Commit" unless commit - commit.diffs.to_a + commit.raw_diffs.to_a end # Get a commit's comments @@ -96,7 +96,7 @@ module API } if params[:path] && params[:line] && params[:line_type] - commit.diffs(all_diffs: true).each do |diff| + commit.raw_diffs(all_diffs: true).each do |diff| next unless diff.new_path == params[:path] lines = Gitlab::Diff::Parser.new.parse(diff.diff.each_line) diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 3e21b7a0b8a..e5b00dc45a5 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -224,7 +224,7 @@ module API class MergeRequestChanges < MergeRequest expose :diffs, as: :changes, using: Entities::RepoDiff do |compare, _| - compare.diffs(all_diffs: true).to_a + compare.raw_diffs(all_diffs: true).to_a end end |