From e0b3c363b11b27499be327d162156ddb534e2e48 Mon Sep 17 00:00:00 2001 From: Brenton Leanhardt Date: Tue, 24 Jun 2008 19:00:13 -0400 Subject: Adding trivial rebase support --- lib/git/base.rb | 5 +++++ lib/git/lib.rb | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/lib/git/base.rb b/lib/git/base.rb index 61b1f62..ad8f504 100644 --- a/lib/git/base.rb +++ b/lib/git/base.rb @@ -303,6 +303,11 @@ module Git def merge(branch, message = 'merge') self.lib.merge(branch, message) end + + # rebases the current working branch to 'branch' + def rebase(branch) + self.lib.rebase(branch) + end # iterates over the files which are unmerged # diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 2998194..69a31bd 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -475,6 +475,12 @@ module Git unmerged end + def rebase(branch) + arr_opts = [] + arr_opts << branch + command('rebase', arr_opts) + end + def conflicts #yields :file, :your, :their self.unmerged.each do |f| your = Tempfile.new("YOUR-#{File.basename(f)}").path -- cgit