Commit aba8053b authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch '12464-remove-gitpushservice' into 'master'

Remove unused EE::GitPushService

See merge request gitlab-org/gitlab-ee!14483
parents db4911a9 cc9071e7
......@@ -146,11 +146,13 @@ class Gitlab::Seeder::CycleAnalytics
commit_sha = issue.project.repository.create_file(@user, filename, "content", message: "Commit for #{issue.to_reference}", branch_name: branch_name)
issue.project.repository.commit(commit_sha)
GitPushService.new(issue.project,
@user,
oldrev: issue.project.repository.commit("master").sha,
newrev: commit_sha,
ref: 'refs/heads/master').execute
Git::BranchPushService.new(
issue.project,
@user,
oldrev: issue.project.repository.commit("master").sha,
newrev: commit_sha,
ref: 'refs/heads/master'
).execute
branch_name
end
......
# frozen_string_literal: true
module EE
module GitPushService
extend ::Gitlab::Utils::Override
protected
override :execute_related_hooks
def execute_related_hooks
if should_index_commits?
::ElasticCommitIndexerWorker.perform_async(project.id, params[:oldrev], params[:newrev])
end
super
end
private
def should_index_commits?
default_branch? &&
project.use_elasticsearch? &&
::Gitlab::Redis::SharedState.with { |redis| !redis.sismember(:elastic_projects_indexing, project.id) }
end
override :pipeline_options
def pipeline_options
{ mirror_update: project.mirror? && project.repository.up_to_date_with_upstream?(branch_name) }
end
end
end
---
title: Remove unused EE::GitPushService
merge_request: 14483
author:
type: other
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment