summaryrefslogtreecommitdiffstats
path: root/lib/git/lib.rb
diff options
context:
space:
mode:
authorScott Chacon <schacon@gmail.com>2008-03-03 13:00:13 -0800
committerScott Chacon <schacon@gmail.com>2008-03-03 13:00:13 -0800
commitbc09a701262425adee32030c3b25f8b1c0be776e (patch)
treecb3b125fe607ff7fdfcc36546966195866937f0a /lib/git/lib.rb
parentf859e805794378d8b6299c4c4a68be5c25f52e8a (diff)
parent55a5e323d241cfbd5a59d9a440c506b24b4c255a (diff)
downloadthird_party-ruby-git-bc09a701262425adee32030c3b25f8b1c0be776e.tar.gz
third_party-ruby-git-bc09a701262425adee32030c3b25f8b1c0be776e.tar.xz
third_party-ruby-git-bc09a701262425adee32030c3b25f8b1c0be776e.zip
Merge commit 'eric/master' into test
Diffstat (limited to 'lib/git/lib.rb')
-rw-r--r--lib/git/lib.rb32
1 files changed, 31 insertions, 1 deletions
diff --git a/lib/git/lib.rb b/lib/git/lib.rb
index 1a60be6..4c4147d 100644
--- a/lib/git/lib.rb
+++ b/lib/git/lib.rb
@@ -401,8 +401,38 @@ module Git
arr_opts << commit.to_s if commit
command('reset', arr_opts)
end
+
+ def stashes_all
+ arr = []
+ filename = File.join(@git_dir, 'logs/refs/stash')
+ if File.exist?(filename)
+ File.open(filename).each_with_index { |line, i|
+ m = line.match(/:(.*)$/)
+ arr << [i, m[1].strip]
+ }
+ end
+ arr
+ end
+
+ def stash_save(message)
+ output = command('stash save', [message])
+ return false unless output.match(/HEAD is now at/)
+ return true
+ end
-
+ def stash_apply(id)
+ command('stash apply', [id])
+ # Already uptodate! ---???? What then
+ end
+
+ def stash_clear
+ command('stash clear')
+ end
+
+ def stash_list
+ command('stash list')
+ end
+
def branch_new(branch)
command('branch', branch)
end