diff options
author | scott Chacon <schacon@agadorsparticus.(none)> | 2007-11-11 14:37:05 -0800 |
---|---|---|
committer | scott Chacon <schacon@agadorsparticus.(none)> | 2007-11-11 14:37:05 -0800 |
commit | b81ee9305f418209ba0d77fbb7b47b23d4b121ca (patch) | |
tree | f4bef02a3befcbe06be85ff8507cb18242df5f40 /lib/git/lib.rb | |
parent | abcb1453e210beb6de70a69d3501cf842b38636e (diff) | |
download | third_party-ruby-git-b81ee9305f418209ba0d77fbb7b47b23d4b121ca.tar.gz third_party-ruby-git-b81ee9305f418209ba0d77fbb7b47b23d4b121ca.tar.xz third_party-ruby-git-b81ee9305f418209ba0d77fbb7b47b23d4b121ca.zip |
added merging functions
Diffstat (limited to 'lib/git/lib.rb')
-rw-r--r-- | lib/git/lib.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 41b3efb..9b3922e 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -257,6 +257,14 @@ module Git command('checkout', arr_opts) end + def merge(branch, message = nil) + arr_opts = [] + arr_opts << ["-m '#{message}'"] if message + arr_opts << branch.to_a.join(' ') + command('merge', arr_opts) + end + + private def command_lines(cmd, opts = {}) @@ -278,7 +286,10 @@ module Git #puts "git #{cmd} #{opts}" #puts out #puts - if $?.exitstatus > 1 + if $?.exitstatus > 0 + if $?.exitstatus == 1 && out == '' + return '' + end raise Git::GitExecuteError.new(out) end out |