summaryrefslogtreecommitdiff
path: root/gbp
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2011-10-25 11:40:31 +0200
committerGuido Günther <agx@sigxcpu.org>2011-10-26 10:00:53 +0200
commit8ec3769556273e96d128f7203151284bd6765bdd (patch)
treef61d9aee4b63d926b85420d9c9cc1461e4f1e9f6 /gbp
parent3fcf009e6eafa68510c543dbde12341eb14c04d5 (diff)
GitRepository: Add collect_garbage
Diffstat (limited to 'gbp')
-rw-r--r--gbp/git.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/gbp/git.py b/gbp/git.py
index 83f0505..f52b09b 100644
--- a/gbp/git.py
+++ b/gbp/git.py
@@ -840,6 +840,16 @@ class GitRepository(object):
if ret:
raise GitRepositoryError, "unable to archive %s"%(treeish)
+ def collect_garbage(self, auto=False):
+ """
+ Cleanup unnecessary files and optimize the local repository
+
+ param auto: only cleanup if required
+ param auto: bool
+ """
+ args = [ '--auto' ] if auto else []
+ self._git_command("gc", args)
+
def fetch(self, repo=None):
"""
Download objects and refs from another repository.