args = GitArgs('rm', name)
self._git_command("remote", args.args)
- def fetch(self, repo=None, tags=False, depth=0, refspec=None):
+ def fetch(self, repo=None, tags=False, depth=0, refspec=None,
+ all_remotes=False):
"""
Download objects and refs from another repository.
@type depth: C{int}
@param refspec: refspec to use instead of the default from git config
@type refspec: C{str}
+ @param all_remotes: fetch all remotes
+ @type all_remotes: C{bool}
"""
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)
+ if all_remotes:
+ args.add_true(all_remotes, '--all')
+ else:
+ args.add_cond(repo, repo)
+ args.add_cond(refspec, refspec)
self._git_command("fetch", args.args)
>>> clone.fetch('foo')
>>> clone.fetch('foo', tags=True)
>>> clone.fetch('foo', refspec='refs/heads/master')
+ >>> clone.fetch(all_remotes=True)
>>> clone.remove_remote_repo('foo')
"""