summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDJ Mountney <david@twkie.net>2016-08-10 16:53:52 -0700
committerDJ Mountney <david@twkie.net>2016-08-10 16:53:52 -0700
commit939cd374e7831d10b8e3c8b65dd9a2380e8f2393 (patch)
tree5eb23c7c98bfd400f16269a8f1c3e315aa455ddd /lib
parent1e3d15a71ed49a932c6539d1e783b5948f31192e (diff)
downloadgitlab-shell-939cd374e7831d10b8e3c8b65dd9a2380e8f2393.tar.gz
In order to use chomp! on the input later, we need to dup the ARGV input string for keysdup-frozen-argv-key
Also updated the gitlab_key tests to freeze the ARGV variables.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab_keys.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/gitlab_keys.rb b/lib/gitlab_keys.rb
index eb359f8..0eb04eb 100644
--- a/lib/gitlab_keys.rb
+++ b/lib/gitlab_keys.rb
@@ -22,7 +22,8 @@ class GitlabKeys
def initialize
@command = ARGV.shift
@key_id = ARGV.shift
- @key = ARGV.shift
+ key = ARGV.shift
+ @key = key.dup if key
@auth_file = GitlabConfig.new.auth_file
end