summaryrefslogtreecommitdiff
path: root/gbp/git
diff options
context:
space:
mode:
authorLingchaox Xin <lingchaox.xin@intel.com>2013-07-05 17:50:48 +0800
committerGuido Günther <agx@sigxcpu.org>2013-09-10 09:18:11 +0200
commitdb79c5db34498bc353f7d1e10bb1f4b7140d876b (patch)
tree89a0f88e3f1192020e6d2703ae207767519ccd35 /gbp/git
parentd28c7cc11055105262a3eff80f3c3a6885dda594 (diff)
downloadgit-buildpackage-db79c5db34498bc353f7d1e10bb1f4b7140d876b.tar.gz
git-buildpackage-db79c5db34498bc353f7d1e10bb1f4b7140d876b.tar.bz2
git-buildpackage-db79c5db34498bc353f7d1e10bb1f4b7140d876b.zip
GitRepository.pull: Add 'all_remotes' option
Also changes the method to utilize the GitArgs class. Signed-off-by: Lingchaox Xin <lingchaox.xin@intel.com> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/git')
-rw-r--r--gbp/git/repository.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py
index 9a67abf1..fc7857b9 100644
--- a/gbp/git/repository.py
+++ b/gbp/git/repository.py
@@ -1063,7 +1063,7 @@ class GitRepository(object):
self._git_command("fetch", args.args)
- def pull(self, repo=None, ff_only=False):
+ def pull(self, repo=None, ff_only=False, all_remotes=False):
"""
Fetch and merge from another repository
@@ -1071,11 +1071,16 @@ class GitRepository(object):
@type repo: C{str}
@param ff_only: only merge if this results in a fast forward merge
@type ff_only: C{bool}
+ @param all_remotes: fetch all remotes
+ @type all_remotes: C{bool}
"""
- args = []
- args += [ '--ff-only' ] if ff_only else []
- args += [ repo ] if repo else []
- self._git_command("pull", args)
+ args = GitArgs()
+ args.add_true(ff_only, '--ff-only')
+ if all_remotes:
+ args.add_true(all_remotes, '--all')
+ else:
+ args.add_true(repo, repo)
+ self._git_command("pull", args.args)
def push(self, repo=None, src=None, dst=None, ff_only=True, force=False,
tags=False):