i came across something i'm unsure about in deep_merge!. it seems that when merging hash deep_merge! will re-assign dest source.length times if dest is not a hash. i've patched this and specs are green, but i wonder if i'm missing something.--- a/lib/chef/mixin/deep_merge.rb+++ b/lib/chef/mixin/deep_merge.rb@@ -84,17 +84,17 @@ class Chefwhen nildestwhen Hash- source.each do |src_key, src_value|- if dest.kind_of?(Hash)+ if dest.kind_of?(Hash)+ source.each do |src_key, src_value|if dest[src_key]dest[src_key] = deep_merge!(src_value, dest[src_key])else # dest[src_key] doesn't exist so we take whatever source hasraise_if_knockout_used!(src_value)dest[src_key] = src_valueend- else # dest isn't a hash, so we overwrite it completely- dest = sourceend+ else # dest isn't a hash, so we overwrite it completely+ dest = sourceendwhen Arrayif dest.kind_of?(Array)
Archive powered by MHonArc 2.6.16.