diff options
author | Nick Thomas <nick@gitlab.com> | 2018-10-26 23:30:24 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-11-06 12:42:00 +0000 |
commit | 668e5d63fa186112b7ebde2464d026b2a19aa834 (patch) | |
tree | 2fe7c034ab6f1576e87d4611f8810cec9bf8cb6d /lib/gitlab | |
parent | b4ecbef24d87631129e75925a2b23d88400e53a2 (diff) | |
download | gitlab-ce-668e5d63fa186112b7ebde2464d026b2a19aa834.tar.gz |
Stop Repository#fetch_remote from using Gitlab::Shell
This indirection doesn't provide any value, so remove it
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/git/repository.rb | 20 | ||||
-rw-r--r-- | lib/gitlab/shell.rb | 17 |
2 files changed, 20 insertions, 17 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index fcc92341c40..20cd257bb98 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -720,6 +720,26 @@ module Gitlab end end + # Fetch remote for repository + # + # remote - remote name + # ssh_auth - SSH known_hosts data and a private key to use for public-key authentication + # forced - should we use --force flag? + # no_tags - should we use --no-tags flag? + # prune - should we use --prune flag? + def fetch_remote(remote, ssh_auth: nil, forced: false, no_tags: false, prune: true) + wrapped_gitaly_errors do + gitaly_repository_client.fetch_remote( + remote, + ssh_auth: ssh_auth, + forced: forced, + no_tags: no_tags, + prune: prune, + timeout: GITLAB_PROJECTS_TIMEOUT + ) + end + end + def blob_at(sha, path) Gitlab::Git::Blob.find(self, sha, path) unless Gitlab::Git.blank_ref?(sha) end diff --git a/lib/gitlab/shell.rb b/lib/gitlab/shell.rb index 16c1edb2f11..c6a6fb9b5ce 100644 --- a/lib/gitlab/shell.rb +++ b/lib/gitlab/shell.rb @@ -108,23 +108,6 @@ module Gitlab success end - # Fetch remote for repository - # - # repository - an instance of Git::Repository - # remote - remote name - # ssh_auth - SSH known_hosts data and a private key to use for public-key authentication - # forced - should we use --force flag? - # no_tags - should we use --no-tags flag? - # - # Ex. - # fetch_remote(my_repo, "upstream") - # - def fetch_remote(repository, remote, ssh_auth: nil, forced: false, no_tags: false, prune: true) - wrapped_gitaly_errors do - repository.gitaly_repository_client.fetch_remote(remote, ssh_auth: ssh_auth, forced: forced, no_tags: no_tags, timeout: git_timeout, prune: prune) - end - end - # Move repository reroutes to mv_directory which is an alias for # mv_namespace. Given the underlying implementation is a move action, # indescriminate of what the folders might be. |