diff options
author | Lingchaox Xin <lingchaox.xin@intel.com> | 2013-08-07 15:25:21 +0800 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2013-09-04 22:35:23 +0200 |
commit | 171579fa5f27ea91563920d672c5b89d1c16f78b (patch) | |
tree | 6c3646a55d845b227d9b1767ea55a0542426a55e /gbp | |
parent | 1320de2ae2434a89979f1c753fdef67ddcfb4aea (diff) | |
download | git-buildpackage-171579fa5f27ea91563920d672c5b89d1c16f78b.tar.gz git-buildpackage-171579fa5f27ea91563920d672c5b89d1c16f78b.tar.bz2 git-buildpackage-171579fa5f27ea91563920d672c5b89d1c16f78b.zip |
GitRepository.fetch: Add 'all_remotes' option
Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com>
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp')
-rw-r--r-- | gbp/git/repository.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py index ea5deb03..41e64717 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -1013,7 +1013,8 @@ class GitRepository(object): 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. @@ -1025,12 +1026,17 @@ class GitRepository(object): @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) |