diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-07-01 17:24:03 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-07-01 17:24:03 +0200 |
commit | 2e6bbb12f86806ee13699f8cff03f13449105eb9 (patch) | |
tree | cdc959b40361be56eeac44b7ac19ef984fb7a62d /app/models/merge_request.rb | |
parent | 804168e1def1204af712febb229f41a3865f085f (diff) | |
download | gitlab-ce-2e6bbb12f86806ee13699f8cff03f13449105eb9.tar.gz |
Refactor can_be_merged logic for merge request
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r-- | app/models/merge_request.rb | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 040ab0f4b0f..53b3fc10ccb 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -209,13 +209,7 @@ class MergeRequest < ActiveRecord::Base if for_fork? Gitlab::Satellite::MergeAction.new(self.author, self).can_be_merged? else - rugged = project.repository.rugged - our_commit = rugged.branches[target_branch].target - their_commit = rugged.branches[source_branch].target - - if our_commit && their_commit - !rugged.merge_commits(our_commit, their_commit).conflicts? - end + project.repository.can_be_merged?(source_branch, target_branch) end if can_be_merged |