diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2018-09-28 10:50:43 +0200 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2018-09-28 10:50:43 +0200 |
commit | 05441b826b7dc39b1523123e00bf00ce497ef75d (patch) | |
tree | 23e3af91b4e164a08080a64561f8881373fa9976 | |
parent | 1cc2993f357c4467e4d45c54c01d2307103efb3e (diff) | |
download | gitlab-shell-no-glid-argument.tar.gz |
Remove mistaken support for `gitlab-shell user-123`gitlab-shell-no-glid-argument
-rwxr-xr-x | bin/gitlab-shell | 2 | ||||
-rw-r--r-- | spec/gitlab_shell_gitlab_shell_spec.rb | 21 |
2 files changed, 1 insertions, 22 deletions
diff --git a/bin/gitlab-shell b/bin/gitlab-shell index 93a79f6..8d43cf1 100755 --- a/bin/gitlab-shell +++ b/bin/gitlab-shell @@ -19,7 +19,7 @@ require File.join(ROOT_PATH, 'lib', 'gitlab_shell') # We must match e.g. "key-12345" anywhere on the command-line. See # https://gitlab.com/gitlab-org/gitlab-shell/issues/145 -who = /\b(?:(?:key|user)-[0-9]+|username-\S+)\b/.match(ARGV.join(' ')).to_s +who = /\b(?:(?:key)-[0-9]+|username-\S+)\b/.match(ARGV.join(' ')).to_s if GitlabShell.new(who).exec(original_cmd) exit 0 diff --git a/spec/gitlab_shell_gitlab_shell_spec.rb b/spec/gitlab_shell_gitlab_shell_spec.rb index abe71e1..9afeac8 100644 --- a/spec/gitlab_shell_gitlab_shell_spec.rb +++ b/spec/gitlab_shell_gitlab_shell_spec.rb @@ -69,13 +69,6 @@ describe 'bin/gitlab-shell' do expect(status).to be_success end - it 'succeeds and prints username when a valid known user id is given' do - output, status = run!(["user-10"]) - - expect(output).to eq("Welcome to GitLab, @someuser!\n") - expect(status).to be_success - end - it 'succeeds and prints username when a valid known username is given' do output, status = run!(["username-someuser"]) @@ -91,13 +84,6 @@ describe 'bin/gitlab-shell' do expect(status).to be_success end - it 'succeeds and prints Anonymous when a valid unknown user id is given' do - output, status = run!(["user-12345"]) - - expect(output).to eq("Welcome to GitLab, Anonymous!\n") - expect(status).to be_success - end - it 'succeeds and prints Anonymous when a valid unknown username is given' do output, status = run!(["username-unknown"]) @@ -136,13 +122,6 @@ describe 'bin/gitlab-shell' do expect(status).to be_success end - it 'succeeds and prints username when a valid known user id is given in the middle of other input' do - output, status = run!(["-c/usr/share/webapps/gitlab-shell/bin/gitlab-shell", "user-10", "2foo"]) - - expect(output).to eq("Welcome to GitLab, @someuser!\n") - expect(status).to be_success - end - it 'succeeds and prints username when a valid known username is given in the middle of other input' do output, status = run!(["-c/usr/share/webapps/gitlab-shell/bin/gitlab-shell", "username-someuser" ,"foo"]) |