diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-08-04 00:32:12 +0300 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-08-04 00:32:12 +0300 |
commit | 631f59d4e7f449c59735cd7eab25cf407e06d5d8 (patch) | |
tree | 59846f103b348fc39f76798533cfd0a933526a94 /app/models/merge_request_diff.rb | |
parent | 6a9283600cd4a11b97fe26772e68095d8dc854bd (diff) |
change the API on the merge_request_diff model from diffs -> raw_diffs
Diffstat (limited to 'app/models/merge_request_diff.rb')
-rw-r--r-- | app/models/merge_request_diff.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/merge_request_diff.rb b/app/models/merge_request_diff.rb index 119266f2d2c..fa0efe2d596 100644 --- a/app/models/merge_request_diff.rb +++ b/app/models/merge_request_diff.rb @@ -33,12 +33,12 @@ class MergeRequestDiff < ActiveRecord::Base end def size - real_size.presence || diffs.size + real_size.presence || raw_diffs.size end - def diffs(options={}) + def raw_diffs(options={}) if options[:ignore_whitespace_change] - @diffs_no_whitespace ||= begin + @raw_diffs_no_whitespace ||= begin compare = Gitlab::Git::Compare.new( repository.raw_repository, self.start_commit_sha || self.target_branch_sha, @@ -47,8 +47,8 @@ class MergeRequestDiff < ActiveRecord::Base compare.diffs(options) end else - @diffs ||= {} - @diffs[options] ||= load_diffs(st_diffs, options) + @raw_diffs ||= {} + @raw_diffs[options] ||= load_diffs(st_diffs, options) end end |