From 8ec3769556273e96d128f7203151284bd6765bdd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Guido=20G=C3=BCnther?= Date: Tue, 25 Oct 2011 11:40:31 +0200 Subject: [PATCH] GitRepository: Add collect_garbage --- gbp/git.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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. -- 2.7.4