summaryrefslogtreecommitdiff
path: root/gbp/git/repository.py
diff options
context:
space:
mode:
Diffstat (limited to 'gbp/git/repository.py')
-rw-r--r--gbp/git/repository.py5
1 files changed, 4 insertions, 1 deletions
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)