summaryrefslogtreecommitdiffstats
path: root/lib/git/lib.rb
diff options
context:
space:
mode:
authorScott Chacon <schacon@gmail.com>2008-05-27 12:30:45 -0700
committerScott Chacon <schacon@gmail.com>2008-05-27 12:30:45 -0700
commit743ac297402ce8713d1c58db42c8a0540cb026a8 (patch)
treea0ef7cc04f57555e6c996056f313daf41d55a6a9 /lib/git/lib.rb
parenteac13c4070d7190472fa1e233a715bb6eb694552 (diff)
downloadthird_party-ruby-git-743ac297402ce8713d1c58db42c8a0540cb026a8.tar.gz
third_party-ruby-git-743ac297402ce8713d1c58db42c8a0540cb026a8.tar.xz
third_party-ruby-git-743ac297402ce8713d1c58db42c8a0540cb026a8.zip
added apply and am functions and --until to logs
Diffstat (limited to 'lib/git/lib.rb')
-rw-r--r--lib/git/lib.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/git/lib.rb b/lib/git/lib.rb
index 033df12..5e597ad 100644
--- a/lib/git/lib.rb
+++ b/lib/git/lib.rb
@@ -67,6 +67,7 @@ module Git
arr_opts = ['--pretty=oneline']
arr_opts << "-#{opts[:count]}" if opts[:count]
arr_opts << "--since=\"#{opts[:since]}\"" if opts[:since].is_a? String
+ arr_opts << "--until=\"#{opts[:until]}\"" if opts[:until].is_a? String
arr_opts << "#{opts[:between][0].to_s}..#{opts[:between][1].to_s}" if (opts[:between] && opts[:between].size == 2)
arr_opts << opts[:object] if opts[:object].is_a? String
arr_opts << '-- ' + opts[:path_limiter] if opts[:path_limiter].is_a? String
@@ -78,6 +79,7 @@ module Git
arr_opts = ['--pretty=raw']
arr_opts << "-#{opts[:count]}" if opts[:count]
arr_opts << "--since=\"#{opts[:since]}\"" if opts[:since].is_a? String
+ arr_opts << "--until=\"#{opts[:until]}\"" if opts[:until].is_a? String
arr_opts << "#{opts[:between][0].to_s}..#{opts[:between][1].to_s}" if (opts[:between] && opts[:between].size == 2)
arr_opts << opts[:object] if opts[:object].is_a? String
arr_opts << '-- ' + opts[:path_limiter] if opts[:path_limiter].is_a? String
@@ -387,6 +389,18 @@ module Git
command('reset', arr_opts)
end
+ def apply(patch_file)
+ arr_opts = []
+ arr_opts << patch_file.to_s if patch_file
+ command('apply', arr_opts)
+ end
+
+ def apply_mail(patch_file)
+ arr_opts = []
+ arr_opts << patch_file.to_s if patch_file
+ command('am', arr_opts)
+ end
+
def stashes_all
arr = []
filename = File.join(@git_dir, 'logs/refs/stash')
@@ -429,6 +443,7 @@ module Git
def checkout(branch, opts = {})
arr_opts = []
arr_opts << '-f' if opts[:force]
+ arr_opts << ["-b '#{opts[:new_branch]}'"] if opts[:new_branch]
arr_opts << branch.to_s
command('checkout', arr_opts)