diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-06-20 14:15:28 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-06-20 14:15:28 +0000 |
commit | a5245fd8b842c0d87161254cfa6ef257f9d22ed9 (patch) | |
tree | 138e170b7956476b75f8938f7817e2a4192f81e8 /lib | |
parent | 00518d261d2e5b751bb5da93531880d4b3eb4250 (diff) | |
parent | 46b56b18f5bf94662a8500e2b8789f504b5d6ea8 (diff) | |
download | gitlab-ce-a5245fd8b842c0d87161254cfa6ef257f9d22ed9.tar.gz |
Merge branch 'zj-can-be-merged' into 'master'
Move mergablility check to Gitaly
Closes gitaly#889
See merge request gitlab-org/gitlab-ce!20019
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/git/repository.rb | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 7ce90ce170f..77543206e13 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -1413,13 +1413,8 @@ module Gitlab end def can_be_merged?(source_sha, target_branch) - gitaly_migrate(:can_be_merged) do |is_enabled| - if is_enabled - gitaly_can_be_merged?(source_sha, find_branch(target_branch, true).target) - else - rugged_can_be_merged?(source_sha, target_branch) - end - end + target_sha = find_branch(target_branch, true).target + !gitaly_conflicts_client(source_sha, target_sha).conflicts? end def search_files_by_name(query, ref) @@ -2232,14 +2227,6 @@ module Gitlab run_git(['fetch', remote_name], env: env).last.zero? end - def gitaly_can_be_merged?(their_commit, our_commit) - !gitaly_conflicts_client(our_commit, their_commit).conflicts? - end - - def rugged_can_be_merged?(their_commit, our_commit) - !rugged.merge_commits(our_commit, their_commit).conflicts? - end - def gitlab_projects_error raise CommandError, @gitlab_projects.output end |