Commit 4f8e91fa authored by Robert Speicher's avatar Robert Speicher

Merge branch 'dup-frozen-argv-key' into 'master'

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.

Fixes https://gitlab.com/gitlab-org/gitlab-shell/issues/56

See merge request !84
parents 627b29c5 939cd374
...@@ -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