Commit a0c7bc96 authored by Alejandro Rodríguez's avatar Alejandro Rodríguez

Incorporate Gitaly's RepositoryService.IsSquashInProgress RPC

parent b2761d17
Pipeline #17326386 passed with stages
in 30 minutes and 23 seconds
......@@ -1234,7 +1234,13 @@ module Gitlab
end
def squash_in_progress?(squash_id)
fresh_worktree?(worktree_path(SQUASH_WORKTREE_PREFIX, squash_id))
gitaly_migrate(:squash_in_progress) do |is_enabled|
if is_enabled
gitaly_repository_client.squash_in_progress?(squash_id)
else
fresh_worktree?(worktree_path(SQUASH_WORKTREE_PREFIX, squash_id))
end
end
end
def push_remote_branches(remote_name, branch_names, forced: true)
......
......@@ -134,6 +134,23 @@ module Gitlab
response.in_progress
end
def squash_in_progress?(squash_id)
request = Gitaly::IsSquashInProgressRequest.new(
repository: @gitaly_repo,
squash_id: squash_id.to_s
)
response = GitalyClient.call(
@storage,
:repository_service,
:is_squash_in_progress,
request,
timeout: GitalyClient.default_timeout
)
response.in_progress
end
def fetch_source_branch(source_repository, source_branch, local_ref)
request = Gitaly::FetchSourceBranchRequest.new(
repository: @gitaly_repo,
......
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