diff options
author | Nick Thomas <nick@gitlab.com> | 2018-08-14 22:48:56 +0100 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2018-08-14 22:48:56 +0100 |
commit | 1666dfdae141cceab35cc30baa253e2676b5ed65 (patch) | |
tree | 19aeec667ec591c02d498910fbe1526d19770643 /bin | |
parent | 02457041814fe4497b3df00e0e45edbee107c823 (diff) | |
parent | 5287eee65e7f29e8d5296eb3ef24a06a9a60b3f1 (diff) | |
download | gitlab-shell-1666dfdae141cceab35cc30baa253e2676b5ed65.tar.gz |
Merge remote-tracking branch 'upstream/8-1-stable' into 148-merge-8-1-1-to-master
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/gitlab-shell | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/gitlab-shell b/bin/gitlab-shell index 1016570..93a79f6 100755 --- a/bin/gitlab-shell +++ b/bin/gitlab-shell @@ -17,7 +17,11 @@ require_relative '../lib/gitlab_init' # require File.join(ROOT_PATH, 'lib', 'gitlab_shell') -if GitlabShell.new(ARGV.join).exec(original_cmd) +# 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 + +if GitlabShell.new(who).exec(original_cmd) exit 0 else exit 1 |