From 31b4f2b80616f570c83ed62d20f8b14ec5ba425b Mon Sep 17 00:00:00 2001 From: scott Chacon Date: Sun, 11 Nov 2007 17:11:19 -0800 Subject: adding my testing git directory --- lib/git/base.rb | 11 +++++++++++ lib/git/lib.rb | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/git/base.rb b/lib/git/base.rb index ffd8a2b..d97948e 100644 --- a/lib/git/base.rb +++ b/lib/git/base.rb @@ -90,6 +90,14 @@ module Git end end + def repo_size + size = 0 + Dir.chdir(repo.path) do + (size, dot) = `du -d0`.chomp.split + end + size.to_i + end + #g.config('user.name', 'Scott Chacon') # sets value #g.config('user.email', 'email@email.com') # sets value #g.config('user.name') # returns 'Scott Chacon' @@ -221,6 +229,9 @@ module Git # convenience methods + def repack + self.lib.repack + end def revparse(objectish) self.lib.revparse(objectish) diff --git a/lib/git/lib.rb b/lib/git/lib.rb index 93490db..3f97929 100644 --- a/lib/git/lib.rb +++ b/lib/git/lib.rb @@ -300,7 +300,9 @@ module Git command('show-ref', ['--tags', '-s', tag_name]) end - + def repack + command('repack', ['-a', '-d']) + end private -- cgit