diff options
author | Stan Hu <stanhu@gmail.com> | 2017-07-21 12:35:26 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-07-21 13:08:52 -0700 |
commit | f5591f68c1439eda836460e0dec44f610709a5b8 (patch) | |
tree | 6d85f1686ddf6317001d116ad53e37e616e6697c /lib/gitlab_shell.rb | |
parent | 914f968523779972e74f5a12a9e6b668c184c898 (diff) | |
download | gitlab-shell-f5591f68c1439eda836460e0dec44f610709a5b8.tar.gz |
Support unhiding of all refs for Geo Nodes
By default, we hide certain refs (e.g. keep-around/XXX) to save user
download time. We need to preserve these references on secondary Geo
nodes to have a true copy.
Diffstat (limited to 'lib/gitlab_shell.rb')
-rw-r--r-- | lib/gitlab_shell.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb index 262f9f7..e3025ef 100644 --- a/lib/gitlab_shell.rb +++ b/lib/gitlab_shell.rb @@ -17,7 +17,7 @@ class GitlabShell API_COMMANDS = %w(2fa_recovery_codes) GL_PROTOCOL = 'ssh'.freeze - attr_accessor :key_id, :gl_repository, :repo_name, :command, :git_access + attr_accessor :key_id, :gl_repository, :repo_name, :command, :git_access, :show_all_refs attr_reader :repo_path def initialize(key_id) @@ -100,6 +100,7 @@ class GitlabShell self.repo_path = status.repository_path @gl_repository = status.gl_repository @gitaly = status.gitaly + @show_all_refs = status.geo_node end def process_cmd(args) @@ -159,6 +160,10 @@ class GitlabShell env['GITALY_TOKEN'] = @gitaly['token'] end + # 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 + env['GIT_CONFIG_PARAMETERS'] = "'transfer.hideRefs=!refs'" if @show_all_refs + if git_trace_available? env.merge!({ 'GIT_TRACE' => @config.git_trace_log_file, |