Commit 4147a2db authored by Jacob Vosmaer (GitLab)'s avatar Jacob Vosmaer (GitLab) Committed by Sean McGivern

Annotate Gitlab::Git::Repository#fetch_ref

parent 34c57e09
...@@ -826,6 +826,10 @@ module Gitlab ...@@ -826,6 +826,10 @@ module Gitlab
end end
end end
# This method, fetch_ref, is used from within
# Gitlab::Git::OperationService. OperationService will eventually only
# exist in gitaly-ruby. When we delete OperationService from gitlab-ce
# we can also remove fetch_ref.
def fetch_ref(source_repository, source_ref:, target_ref:) def fetch_ref(source_repository, source_ref:, target_ref:)
Gitlab::Git.check_namespace!(source_repository) Gitlab::Git.check_namespace!(source_repository)
source_repository = RemoteRepository.new(source_repository) unless source_repository.is_a?(RemoteRepository) source_repository = RemoteRepository.new(source_repository) unless source_repository.is_a?(RemoteRepository)
......
...@@ -25,6 +25,7 @@ module Gitlab ...@@ -25,6 +25,7 @@ module Gitlab
@project.repository.create_branch(@merge_request.target_branch, @merge_request.target_branch_sha) @project.repository.create_branch(@merge_request.target_branch, @merge_request.target_branch_sha)
end end
# Gitaly migration: https://gitlab.com/gitlab-org/gitaly/issues/1295
def fetch_ref def fetch_ref
@project.repository.fetch_ref(@project.repository, source_ref: @diff_head_sha, target_ref: @merge_request.source_branch) @project.repository.fetch_ref(@project.repository, source_ref: @diff_head_sha, target_ref: @merge_request.source_branch)
end end
......
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