lib/ro/git.rb in ro-1.3.3 vs lib/ro/git.rb in ro-1.3.4
- old
+ new
@@ -21,11 +21,11 @@
def patch(*args, &block)
options = Map.options_for!(args)
user = options[:user] || ENV['USER'] || 'ro'
msg = options[:message] || "#{ user } edits on #{ File.basename(@root).inspect }"
- add = options[:add]
+ add = options.has_key?(:add) ? options[:add] : true
patch = nil
Thread.exclusive do
@root.lock do
@@ -66,19 +66,19 @@
# the block can perform arbitrary edits
#
block.call
- # add all changes - additions, deletions, or modifications - if :add => true was specified
+ # add all changes - additions, deletions, or modifications - unless :add => false was specified
#
if add
spawn("git add . --all", :raise => true)
end
# commit if anything changed
#
changes_to_apply =
- spawn("git commit -am #{ msg.inspect }")
+ spawn("git commit -m #{ msg.inspect }")
if changes_to_apply
# create the patch
#
status, stdout, stderr =