summaryrefslogtreecommitdiff
path: root/lib/gitlab/git/remote_mirror.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/git/remote_mirror.rb')
-rw-r--r--lib/gitlab/git/remote_mirror.rb16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/gitlab/git/remote_mirror.rb b/lib/gitlab/git/remote_mirror.rb
index e992d522e7f..df3cd422527 100644
--- a/lib/gitlab/git/remote_mirror.rb
+++ b/lib/gitlab/git/remote_mirror.rb
@@ -5,14 +5,24 @@ module Gitlab
class RemoteMirror
include Gitlab::Git::WrapsGitalyErrors
- def initialize(repository, ref_name)
+ attr_reader :repository, :ref_name, :only_branches_matching, :ssh_key, :known_hosts
+
+ def initialize(repository, ref_name, only_branches_matching: [], ssh_key: nil, known_hosts: nil)
@repository = repository
@ref_name = ref_name
+ @only_branches_matching = only_branches_matching
+ @ssh_key = ssh_key
+ @known_hosts = known_hosts
end
- def update(only_branches_matching: [])
+ def update
wrapped_gitaly_errors do
- @repository.gitaly_remote_client.update_remote_mirror(@ref_name, only_branches_matching)
+ repository.gitaly_remote_client.update_remote_mirror(
+ ref_name,
+ only_branches_matching,
+ ssh_key: ssh_key,
+ known_hosts: known_hosts
+ )
end
end
end