From 8ec3769556273e96d128f7203151284bd6765bdd Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Tue, 25 Oct 2011 11:40:31 +0200 Subject: GitRepository: Add collect_garbage --- gbp/git.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'gbp/git.py') 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. -- cgit v1.2.3