Permalink
Browse files

dup inputs when merging/rebasing in values

merge, merge_given, rebase, rebase_given should give back input objects that do not mutate each other
  • Loading branch information...
1 parent 18ac405 commit e917afc2cd939ebe7f0ed023456acea35b0e081b @vito vito committed Feb 6, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/mothership/inputs.rb
View
@@ -32,15 +32,15 @@ def merge(inputs)
end
def merge_given(given)
- self.class.new(@command, @context, @inputs, @given.merge(given), @global)
+ self.class.new(@command, @context, @inputs.dup, @given.merge(given), @global)
end
def rebase(inputs)
self.class.new(@command, @context, inputs.merge(@inputs), @given, @global)
end
def rebase_given(given)
- self.class.new(@command, @context, @inputs, given.merge(@given), @global)
+ self.class.new(@command, @context, @inputs.dup, given.merge(@given), @global)
end
def without(*names)

0 comments on commit e917afc

Please sign in to comment.