summaryrefslogtreecommitdiff
path: root/bin/gitlab-shell
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2018-08-15 19:52:42 +0000
committerRobert Speicher <robert@gitlab.com>2018-08-15 19:52:42 +0000
commit122d84a403d3534dea743d94aa23d4115cc804a8 (patch)
tree19aeec667ec591c02d498910fbe1526d19770643 /bin/gitlab-shell
parent02457041814fe4497b3df00e0e45edbee107c823 (diff)
parent1666dfdae141cceab35cc30baa253e2676b5ed65 (diff)
downloadgitlab-shell-122d84a403d3534dea743d94aa23d4115cc804a8.tar.gz
Merge branch '148-merge-8-1-1-to-master' into 'master'
Resolve "gitlab-shell 8.1.1 not on master" Closes #148 and #145 See merge request gitlab-org/gitlab-shell!230
Diffstat (limited to 'bin/gitlab-shell')
-rwxr-xr-xbin/gitlab-shell6
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