1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

avoid pushing duplicate keys

This commit is contained in:
Jun Jiang 2016-12-17 04:51:04 +08:00 committed by jasl
parent bdcc14b8e5
commit 90c599e1a5

View file

@ -35,7 +35,7 @@ module Capistrano
end
def set(key, value=nil, &block)
@trusted_keys << key if trusted?
@trusted_keys << key if trusted? && !@trusted_keys.include?(key)
remember_location(key)
values[key] = block || value
trace_set(key)
@ -43,7 +43,7 @@ module Capistrano
end
def fetch(key, default=nil, &block)
fetched_keys << key
fetched_keys << key unless fetched_keys.include?(key)
peek(key, default, &block)
end