diff options
author | Stan Hu <stanhu@gmail.com> | 2017-07-24 21:03:47 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-07-24 21:09:19 -0700 |
commit | 2fb171c5eeee032f7027bd5cbbf996e782593298 (patch) | |
tree | e7943bf88232112b1c5adcbc21ba1c2f8bfd5cc5 | |
parent | f5591f68c1439eda836460e0dec44f610709a5b8 (diff) | |
download | gitlab-shell-sh-show-all-refs.tar.gz |
Make geo_node a default parametersh-show-all-refs
-rw-r--r-- | CHANGELOG | 3 | ||||
-rw-r--r-- | lib/gitlab_access_status.rb | 2 | ||||
-rw-r--r-- | lib/gitlab_net.rb | 2 | ||||
-rw-r--r-- | spec/gitlab_access_spec.rb | 4 | ||||
-rw-r--r-- | spec/gitlab_shell_spec.rb | 6 |
5 files changed, 10 insertions, 7 deletions
@@ -1,3 +1,6 @@ +v5.5.0 + - Support unhiding of all references for Geo nodes + v5.4.0 - Update Gitaly vendoring to use new RPC calls instead of old deprecated ones diff --git a/lib/gitlab_access_status.rb b/lib/gitlab_access_status.rb index 494349d..988ff7a 100644 --- a/lib/gitlab_access_status.rb +++ b/lib/gitlab_access_status.rb @@ -3,7 +3,7 @@ require 'json' class GitAccessStatus attr_reader :message, :gl_repository, :repository_path, :gitaly, :geo_node - def initialize(status, message, gl_repository, repository_path, gitaly, geo_node) + def initialize(status, message, gl_repository, repository_path, gitaly, geo_node = false) @status = status @message = message @gl_repository = gl_repository diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb index 1a6c016..3acebea 100644 --- a/lib/gitlab_net.rb +++ b/lib/gitlab_net.rb @@ -39,7 +39,7 @@ class GitlabNet if resp.code == '200' GitAccessStatus.create_from_json(resp.body) else - GitAccessStatus.new(false, 'API is not accessible', nil, nil, nil, false) + GitAccessStatus.new(false, 'API is not accessible', nil, nil, nil) end end diff --git a/spec/gitlab_access_spec.rb b/spec/gitlab_access_spec.rb index c95a3be..f91a8a5 100644 --- a/spec/gitlab_access_spec.rb +++ b/spec/gitlab_access_spec.rb @@ -7,7 +7,7 @@ describe GitlabAccess do let(:repo_path) { File.join(repository_path, repo_name) + ".git" } let(:api) do double(GitlabNet).tap do |api| - api.stub(check_access: GitAccessStatus.new(true, 'ok', 'project-1', '/home/git/repositories', nil, false)) + api.stub(check_access: GitAccessStatus.new(true, 'ok', 'project-1', '/home/git/repositories', nil)) end end subject do @@ -38,7 +38,7 @@ describe GitlabAccess do context "access is denied" do before do - api.stub(check_access: GitAccessStatus.new(false, 'denied', nil, nil, nil, false)) + api.stub(check_access: GitAccessStatus.new(false, 'denied', nil, nil, nil)) end it "returns false" do diff --git a/spec/gitlab_shell_spec.rb b/spec/gitlab_shell_spec.rb index 7908b09..87389b4 100644 --- a/spec/gitlab_shell_spec.rb +++ b/spec/gitlab_shell_spec.rb @@ -19,12 +19,12 @@ describe GitlabShell do end end - let(:gitaly_check_access) { GitAccessStatus.new(true, 'ok', gl_repository, repo_path, { 'repository' => { 'relative_path' => repo_name, 'storage_name' => 'default'} , 'address' => 'unix:gitaly.socket' }, false) } + let(:gitaly_check_access) { GitAccessStatus.new(true, 'ok', gl_repository, repo_path, { 'repository' => { 'relative_path' => repo_name, 'storage_name' => 'default'} , 'address' => 'unix:gitaly.socket' }) } let(:api) do double(GitlabNet).tap do |api| api.stub(discover: { 'name' => 'John Doe' }) - api.stub(check_access: GitAccessStatus.new(true, 'ok', gl_repository, repo_path, nil, false)) + api.stub(check_access: GitAccessStatus.new(true, 'ok', gl_repository, repo_path, nil)) api.stub(two_factor_recovery_codes: { 'success' => true, 'recovery_codes' => ['f67c514de60c4953', '41278385fc00c1e0'] @@ -326,7 +326,7 @@ describe GitlabShell do end it "should disallow access and log the attempt if check_access returns false status" do - api.stub(check_access: GitAccessStatus.new(false, 'denied', nil, nil, nil, false)) + api.stub(check_access: GitAccessStatus.new(false, 'denied', nil, nil, nil)) message = "gitlab-shell: Access denied for git command <git-upload-pack gitlab-ci.git> " message << "by user with key #{key_id}." $logger.should_receive(:warn).with(message) |