Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-06-19 18:55:02 +0300
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-06-20 10:11:55 +0300
commit46b56b18f5bf94662a8500e2b8789f504b5d6ea8 (patch)
treeebb5ed5636a4998e7750ff2c6592309bc94732d5 /lib/gitlab
parent38edd5c33e5d88a950ee13809240260cb78568fc (diff)
Move mergablility check to Gitaly
Closes https://gitlab.com/gitlab-org/gitaly/issues/889
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/git/repository.rb17
1 files changed, 2 insertions, 15 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index ab0e6e33db7..7af40e62395 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)
@@ -2236,14 +2231,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