diff options
| author | Stan Hu <stanhu@gmail.com> | 2018-01-10 13:03:31 -0800 |
|---|---|---|
| committer | Nick Thomas <nick@gitlab.com> | 2018-01-12 14:36:45 +0000 |
| commit | 9ac02447386495c54236e8e8ba702a54931a4e61 (patch) | |
| tree | 2f9123523a76d78bbff0594522f077ef4ea015ac /lib | |
| parent | 58ceab7279066faaaa15e16afb842fee4b7eff49 (diff) | |
| download | gitlab-shell-9ac02447386495c54236e8e8ba702a54931a4e61.tar.gz | |
Remove special case treatment of Geo nodes for SSH
We removed SSH support in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/3553,
so we no longer need the ability to show all refs for Geo nodes.
Closes #115
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gitlab_access_status.rb | 8 | ||||
| -rw-r--r-- | lib/gitlab_net.rb | 3 | ||||
| -rw-r--r-- | lib/gitlab_shell.rb | 10 |
3 files changed, 5 insertions, 16 deletions
diff --git a/lib/gitlab_access_status.rb b/lib/gitlab_access_status.rb index 69d914e..0b32dc9 100644 --- a/lib/gitlab_access_status.rb +++ b/lib/gitlab_access_status.rb @@ -1,16 +1,15 @@ require 'json' class GitAccessStatus - attr_reader :message, :gl_repository, :gl_username, :repository_path, :gitaly, :geo_node + attr_reader :message, :gl_repository, :gl_username, :repository_path, :gitaly - def initialize(status, message, gl_repository:, gl_username:, repository_path:, gitaly:, geo_node:) + def initialize(status, message, gl_repository:, gl_username:, repository_path:, gitaly:) @status = status @message = message @gl_repository = gl_repository @gl_username = gl_username @repository_path = repository_path @gitaly = gitaly - @geo_node = geo_node end def self.create_from_json(json) @@ -20,8 +19,7 @@ class GitAccessStatus gl_repository: values["gl_repository"], gl_username: values["gl_username"], repository_path: values["repository_path"], - gitaly: values["gitaly"], - geo_node: values["geo_node"]) + gitaly: values["gitaly"]) end def allowed? diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb index 924a784..3f8c280 100644 --- a/lib/gitlab_net.rb +++ b/lib/gitlab_net.rb @@ -44,8 +44,7 @@ class GitlabNet gl_repository: nil, gl_username: nil, repository_path: nil, - gitaly: nil, - geo_node: false) + gitaly: nil) end end diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb index e7e7f04..1452f95 100644 --- a/lib/gitlab_shell.rb +++ b/lib/gitlab_shell.rb @@ -16,11 +16,8 @@ class GitlabShell } API_COMMANDS = %w(2fa_recovery_codes) GL_PROTOCOL = 'ssh'.freeze - # We have to use a negative transfer.hideRefs since this is the only way - # to undo an already set parameter: https://www.spinics.net/lists/git/msg256772.html - GIT_CONFIG_SHOW_ALL_REFS = "transfer.hideRefs=!refs".freeze - attr_accessor :key_id, :gl_repository, :repo_name, :command, :git_access, :show_all_refs, :username + attr_accessor :key_id, :gl_repository, :repo_name, :command, :git_access, :username attr_reader :repo_path def initialize(key_id) @@ -112,7 +109,6 @@ class GitlabShell self.repo_path = status.repository_path @gl_repository = status.gl_repository @gitaly = status.gitaly - @show_all_refs = status.geo_node @username = status.gl_username end @@ -144,8 +140,6 @@ class GitlabShell 'gl_username' => @username } - gitaly_request['git_config_options'] = [GIT_CONFIG_SHOW_ALL_REFS] if @show_all_refs - args = [gitaly_address, JSON.dump(gitaly_request)] end @@ -177,8 +171,6 @@ class GitlabShell env['GITALY_TOKEN'] = @gitaly['token'] end - env['GIT_CONFIG_PARAMETERS'] = "'#{GIT_CONFIG_SHOW_ALL_REFS}'" if @show_all_refs - if git_trace_available? env.merge!({ 'GIT_TRACE' => @config.git_trace_log_file, |
