Commit 939cd374 authored by DJ Mountney's avatar DJ Mountney

In order to use chomp! on the input later, we need to dup the ARGV input string for keys

Also updated the gitlab_key tests to freeze the ARGV variables.
parent 1e3d15a7
...@@ -22,7 +22,8 @@ class GitlabKeys ...@@ -22,7 +22,8 @@ class GitlabKeys
def initialize def initialize
@command = ARGV.shift @command = ARGV.shift
@key_id = ARGV.shift @key_id = ARGV.shift
@key = ARGV.shift key = ARGV.shift
@key = key.dup if key
@auth_file = GitlabConfig.new.auth_file @auth_file = GitlabConfig.new.auth_file
end end
......
...@@ -284,7 +284,7 @@ describe GitlabKeys do ...@@ -284,7 +284,7 @@ describe GitlabKeys do
def argv(*args) def argv(*args)
args.each_with_index do |arg, i| args.each_with_index do |arg, i|
ARGV[i] = arg ARGV[i] = arg.freeze
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment