diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-08-16 13:00:24 +0200 |
---|---|---|
committer | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2018-08-16 15:06:03 +0200 |
commit | 2d212e401e099543f7612e67ff35b4e8b10593c0 (patch) | |
tree | c8d38ce1c033d3ad5acf4407a1447f3b95eb6cf2 /lib/gitlab_shell.rb | |
parent | fb8606f65a60808e52539f71f09fba871b5aba6b (diff) | |
download | gitlab-shell-2d212e401e099543f7612e67ff35b4e8b10593c0.tar.gz |
Remove repo_path from GitlabShellzj-remove-repo-path
The internal api returns '/' from gitlab, since
`8fad07383ada021fc995294fd0fe0f77fe37da35` from GitLab CE. To clean up
later, https://gitlab.com/gitlab-org/gitlab-shell/issues/135 was
created.
This change closes that issue, making it possible to remove the field
from the response on GitLab-CE too. Given the Rails app always returns
`/` as the repository_path, the associated checks are basically a noop
too. The tests are updated and at times look a little fishy, but those
are testing code that is to be removed in another MR.
Closes https://gitlab.com/gitlab-org/gitlab-shell/issues/135
Diffstat (limited to 'lib/gitlab_shell.rb')
-rw-r--r-- | lib/gitlab_shell.rb | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb index 11494e0..4cabd37 100644 --- a/lib/gitlab_shell.rb +++ b/lib/gitlab_shell.rb @@ -19,7 +19,6 @@ class GitlabShell # rubocop:disable Metrics/ClassLength GL_PROTOCOL = 'ssh'.freeze attr_accessor :gl_id, :gl_repository, :repo_name, :command, :git_access, :git_protocol - attr_reader :repo_path def initialize(who) who_sym, = GitlabNet.parse_who(who) @@ -116,7 +115,6 @@ class GitlabShell # rubocop:disable Metrics/ClassLength raise AccessDeniedError, status.message unless status.allowed? - self.repo_path = status.repository_path @gl_repository = status.gl_repository @git_protocol = ENV['GIT_PROTOCOL'] @gitaly = status.gitaly @@ -139,7 +137,7 @@ class GitlabShell # rubocop:disable Metrics/ClassLength end executable = @command - args = [repo_path] + args = [] if GITALY_MIGRATED_COMMANDS.key?(executable) && @gitaly executable = GITALY_MIGRATED_COMMANDS[executable] @@ -293,11 +291,4 @@ class GitlabShell # rubocop:disable Metrics/ClassLength return false end end - - def repo_path=(repo_path) - raise ArgumentError, "Repository path not provided. Please make sure you're using GitLab v8.10 or later." unless repo_path - raise InvalidRepositoryPathError if File.absolute_path(repo_path) != repo_path - - @repo_path = repo_path - end end |