diff options
author | Sean McGivern <sean@gitlab.com> | 2016-12-26 17:27:20 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2016-12-26 17:27:20 +0300 |
commit | ed6900caf107ad0fc4580ad7dc000284d91683d4 (patch) | |
tree | 0fa88376a3a8378636d1ae5b26f9f548186270ed /app/models | |
parent | ee5cc454d78f0f244fb99f0ec3f5060fd1905c48 (diff) |
Use raw_diffs to calculate MR files changed
We don't need to create the intermediate FileCollection object with its
associated highlighting in order to count how many files changed. Both
the compare object and the MR diff object have a raw_diffs method that
is perfectly fine for this case.
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/merge_request.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 5ce20cc43d6..22490d121c7 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -198,7 +198,9 @@ class MergeRequest < ActiveRecord::Base end def diff_size - diffs(diff_options).size + opts = diff_options || {} + + raw_diffs(opts).size end def diff_base_commit |