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.
@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)
>>> clone.add_remote_repo('foo', repo_dir)
>>> clone.fetch('foo')
>>> clone.fetch('foo', tags=True)
+ >>> clone.fetch('foo', refspec='refs/heads/master')
>>> clone.remove_remote_repo('foo')
"""