summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Kantrowitz <noah@coderanger.net>2018-07-10 18:46:29 -0700
committerNoah Kantrowitz <noah@coderanger.net>2018-07-10 18:46:29 -0700
commit41881272af33a831baec0c491565586cd5f1b77f (patch)
treeb42a153a58a3c6ba1206c34435e262496825dfb0
parentcac581165b5fb115b4a483f3fc1a84d361b08179 (diff)
downloadchef-41881272af33a831baec0c491565586cd5f1b77f.tar.gz
Don't mutate the argument because that makes debugging weird.
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
-rw-r--r--lib/chef/knife/core/subcommand_loader.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/chef/knife/core/subcommand_loader.rb b/lib/chef/knife/core/subcommand_loader.rb
index 026967d6ec..146411a399 100644
--- a/lib/chef/knife/core/subcommand_loader.rb
+++ b/lib/chef/knife/core/subcommand_loader.rb
@@ -139,6 +139,7 @@ class Chef
# hash composed of the given words joined by the separator.
#
def find_longest_key(hash, words, sep = "_")
+ words = words.dup
match = nil
until match || words.empty?
candidate = words.join(sep)