diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-03-03 18:38:44 +0100 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-03-03 18:38:44 +0100 |
commit | 1764e1b7cb2bffb9b4c4a69991fe2c4d21ce5459 (patch) | |
tree | b48ca1bad0532a37a19f00f0903a778109a16a3d /app/models/merge_request.rb | |
parent | e1bc808746523309476913033b104345c06c4816 (diff) | |
download | gitlab-ce-1764e1b7cb2bffb9b4c4a69991fe2c4d21ce5459.tar.gz |
Use Gitlab::Git::DiffCollections
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r-- | app/models/merge_request.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 1543ef311d7..025b522cf66 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -48,7 +48,7 @@ class MergeRequest < ActiveRecord::Base after_create :create_merge_request_diff after_update :update_merge_request_diff - delegate :commits, :diffs, :diffs_no_whitespace, to: :merge_request_diff, prefix: nil + delegate :commits, :diffs, :real_size, to: :merge_request_diff, prefix: nil # When this attribute is true some MR validation is ignored # It allows us to close or modify broken merge requests @@ -56,8 +56,7 @@ class MergeRequest < ActiveRecord::Base # Temporary fields to store compare vars # when creating new merge request - attr_accessor :can_be_created, :compare_failed, - :compare_commits, :compare_diffs + attr_accessor :can_be_created, :compare_commits, :compare state_machine :state, initial: :opened do event :close do @@ -182,6 +181,10 @@ class MergeRequest < ActiveRecord::Base merge_request_diff ? merge_request_diff.first_commit : compare_commits.first end + def diff_size + merge_request_diff.size + end + def diff_base_commit if merge_request_diff merge_request_diff.base_commit |