diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/git/base.rb | 11 | ||||
-rw-r--r-- | lib/git/lib.rb | 4 |
2 files changed, 14 insertions, 1 deletions
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 |