From 1320de2ae2434a89979f1c753fdef67ddcfb4aea Mon Sep 17 00:00:00 2001 From: Lingchaox Xin Date: Wed, 10 Jul 2013 11:17:46 +0800 Subject: GitRepository.fetch: Add 'refspec' option Signed-off-by: Lingchaox Xin Signed-off-by: Markus Lehtonen --- gbp/git/repository.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gbp/git') diff --git a/gbp/git/repository.py b/gbp/git/repository.py index 9c55dfd..ea5deb0 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -1013,7 +1013,7 @@ class GitRepository(object): args = GitArgs('rm', name) self._git_command("remote", args.args) - def fetch(self, repo=None, tags=False, depth=0): + def fetch(self, repo=None, tags=False, depth=0, refspec=None): """ Download objects and refs from another repository. @@ -1023,11 +1023,14 @@ class GitRepository(object): @type tags: C{bool} @param depth: deepen the history of (shallow) repository to depth I{depth} @type depth: C{int} + @param refspec: refspec to use instead of the default from git config + @type refspec: C{str} """ args = GitArgs('--quiet') args.add_true(tags, '--tags') args.add_cond(depth, '--depth=%s' % depth) args.add_cond(repo, repo) + args.add_cond(refspec, refspec) self._git_command("fetch", args.args) -- cgit v1.2.3