diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-06-23 09:34:39 -0500 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-07-05 18:03:29 -0500 |
commit | 52c3150ed3340c59faf88fd191af0f92fc318fc5 (patch) | |
tree | e1276461812aa22cddc3539c33f3869d95af9350 | |
parent | 6aa601866c66a62b4ab3db3fa55ab1b5e84e444d (diff) | |
download | gitlab-shell-52c3150ed3340c59faf88fd191af0f92fc318fc5.tar.gz |
Make use of a constant for the used SSH protocol
-rw-r--r-- | lib/gitlab_shell.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb index 1e94369..d9812ce 100644 --- a/lib/gitlab_shell.rb +++ b/lib/gitlab_shell.rb @@ -8,6 +8,7 @@ class GitlabShell class InvalidRepositoryPathError < StandardError; end GIT_COMMANDS = %w(git-upload-pack git-receive-pack git-upload-archive git-annex-shell git-lfs-authenticate).freeze + GL_PROTOCOL = 'ssh'.freeze attr_accessor :key_id, :repo_name, :git_cmd attr_reader :repo_path @@ -85,7 +86,7 @@ class GitlabShell end def verify_access - status = api.check_access(@git_access, @repo_name, @key_id, '_any', 'ssh') + status = api.check_access(@git_access, @repo_name, @key_id, '_any', GL_PROTOCOL) raise AccessDeniedError, status.message unless status.allowed? @@ -132,7 +133,7 @@ class GitlabShell 'LD_LIBRARY_PATH' => ENV['LD_LIBRARY_PATH'], 'LANG' => ENV['LANG'], 'GL_ID' => @key_id, - 'GL_PROTOCOL' => 'ssh' + 'GL_PROTOCOL' => GL_PROTOCOL } if @config.git_annex_enabled? |