diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-07-27 20:00:34 +0300 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-08-03 08:00:20 +0300 |
commit | c86c1905b5574cac234315598d8d715fcaee3ea7 (patch) | |
tree | 31ba7ab51c04b07ea70d15db88f2370f9ca6359e /app/models/commit.rb | |
parent | 1d0c7b74920a94e488e6a2c090abb3e525438053 (diff) |
switch from diff_file_collection to diffs
So we have raw_diffs too
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index a339d47f5f3..d58c2fb8106 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -104,7 +104,7 @@ class Commit end def diff_line_count - @diff_line_count ||= Commit::diff_line_count(self.diffs) + @diff_line_count ||= Commit::diff_line_count(raw_diffs) @diff_line_count end @@ -317,7 +317,11 @@ class Commit nil end - def diff_file_collection(diff_options = nil) + def raw_diffs(*args) + raw.diffs(*args) + end + + def diffs(diff_options = nil) Gitlab::Diff::FileCollection::Commit.new(self, diff_options: diff_options) end @@ -330,7 +334,7 @@ class Commit def repo_changes changes = { added: [], modified: [], removed: [] } - diffs.each do |diff| + raw_diffs.each do |diff| if diff.deleted_file changes[:removed] << diff.old_path elsif diff.renamed_file || diff.new_file |