From db9642ba2d91bb40dcc157dd301e925d5ddedd9e Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sun, 23 Oct 2011 13:47:01 +0200 Subject: Replace GitFetch by GitRepository.fetch() --- gbp/command_wrappers.py | 10 ---------- gbp/git.py | 11 +++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'gbp') diff --git a/gbp/command_wrappers.py b/gbp/command_wrappers.py index 1fcfdbc..33d6823 100644 --- a/gbp/command_wrappers.py +++ b/gbp/command_wrappers.py @@ -230,16 +230,6 @@ class GitCommand(Command): self.run_error = "Couldn't run git %s" % cmd -# FIXME: move to gbp.git.fetch -class GitFetch(GitCommand): - """Wrap git fetch""" - def __init__(self, remote = None): - opts = [] - if remote: - opts += [remote] - GitCommand.__init__(self, 'fetch', opts) - - # FIXME: move to gbp.git.create_tag class GitTag(GitCommand): """Wrap git tag""" diff --git a/gbp/git.py b/gbp/git.py index cb3d74b..7566635 100644 --- a/gbp/git.py +++ b/gbp/git.py @@ -785,6 +785,17 @@ class GitRepository(object): if ret: raise GitRepositoryError, "unable to archive %s"%(treeish) + def fetch(self, repo=None): + """ + Download objects and refs from another repository. + + param repo: repository to fetch from + type repo: string + """ + if repo: + args = [repo] + + self._git_command("fetch", [ args ]) def has_submodules(self): """Does the repo have any submodules?""" -- cgit v1.2.3