summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2018-06-19 15:01:36 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2018-06-19 15:35:17 +0200
commitc2cdefd4413e2b9946d2a50461b338fc60cef1af (patch)
tree3619a07318e6095594264df72cea1c908a3df1b0 /lib
parentd04ac74556e74df89da8f46ed4188b0376b71c3d (diff)
downloadgitlab-ce-c2cdefd4413e2b9946d2a50461b338fc60cef1af.tar.gz
Force push is handled by Gitaly nowzj-force-push-opt-out
Closes gitlab-org/gitaly#348
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/checks/force_push.rb16
-rw-r--r--lib/gitlab/git/repository.rb4
-rw-r--r--lib/gitlab/git/rev_list.rb9
3 files changed, 4 insertions, 25 deletions
diff --git a/lib/gitlab/checks/force_push.rb b/lib/gitlab/checks/force_push.rb
index c9c3050cfc2..87af4a90572 100644
--- a/lib/gitlab/checks/force_push.rb
+++ b/lib/gitlab/checks/force_push.rb
@@ -7,18 +7,10 @@ module Gitlab
# Created or deleted branch
return false if Gitlab::Git.blank_ref?(oldrev) || Gitlab::Git.blank_ref?(newrev)
- GitalyClient.migrate(:force_push) do |is_enabled|
- if is_enabled
- !project
- .repository
- .gitaly_commit_client
- .ancestor?(oldrev, newrev)
- else
- Gitlab::Git::RevList.new(
- project.repository.raw, oldrev: oldrev, newrev: newrev
- ).missed_ref.present?
- end
- end
+ !project
+ .repository
+ .gitaly_commit_client
+ .ancestor?(oldrev, newrev)
end
end
end
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index d12672fc0e6..27a86054a86 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -1476,10 +1476,6 @@ module Gitlab
run_git!(args, lazy_block: block)
end
- def missed_ref(oldrev, newrev)
- run_git!(['rev-list', '--max-count=1', oldrev, "^#{newrev}"])
- end
-
def with_worktree(worktree_path, branch, sparse_checkout_files: nil, env:)
base_args = %w(worktree add --detach)
diff --git a/lib/gitlab/git/rev_list.rb b/lib/gitlab/git/rev_list.rb
index 4e661eceffb..5fdad077eea 100644
--- a/lib/gitlab/git/rev_list.rb
+++ b/lib/gitlab/git/rev_list.rb
@@ -1,5 +1,3 @@
-# Gitaly note: JV: will probably be migrated indirectly by migrating the call sites.
-
module Gitlab
module Git
class RevList
@@ -45,13 +43,6 @@ module Gitlab
&lazy_block)
end
- # This methods returns an array of missed references
- #
- # Should become obsolete after https://gitlab.com/gitlab-org/gitaly/issues/348.
- def missed_ref
- repository.missed_ref(oldrev, newrev).split("\n")
- end
-
private
def execute(args)