Prepare Gitlab::Git::Repository#rebase for Gitaly migration
This commit is contained in:
parent
a0ae886135
commit
0ba0f9de08
|
@ -97,6 +97,11 @@ module Gitlab
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def update_branch(branch_name, newrev, oldrev)
|
||||||
|
ref = Gitlab::Git::BRANCH_REF_PREFIX + branch_name
|
||||||
|
update_ref_in_hooks(ref, newrev, oldrev)
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# Returns [newrev, should_run_after_create, should_run_after_create_branch]
|
# Returns [newrev, should_run_after_create, should_run_after_create_branch]
|
||||||
|
|
|
@ -1212,9 +1212,16 @@ module Gitlab
|
||||||
rebase_path = worktree_path(REBASE_WORKTREE_PREFIX, rebase_id)
|
rebase_path = worktree_path(REBASE_WORKTREE_PREFIX, rebase_id)
|
||||||
env = git_env_for_user(user)
|
env = git_env_for_user(user)
|
||||||
|
|
||||||
|
if remote_repository.is_a?(RemoteRepository)
|
||||||
|
env.merge!(remote_repository.fetch_env)
|
||||||
|
remote_repo_path = GITALY_INTERNAL_URL
|
||||||
|
else
|
||||||
|
remote_repo_path = remote_repository.path
|
||||||
|
end
|
||||||
|
|
||||||
with_worktree(rebase_path, branch, env: env) do
|
with_worktree(rebase_path, branch, env: env) do
|
||||||
run_git!(
|
run_git!(
|
||||||
%W(pull --rebase #{remote_repository.path} #{remote_branch}),
|
%W(pull --rebase #{remote_repo_path} #{remote_branch}),
|
||||||
chdir: rebase_path, env: env
|
chdir: rebase_path, env: env
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue