add GitFetch
authorGuido Günther <agx@sigxcpu.org>
Sat, 24 Oct 2009 16:40:34 +0000 (18:40 +0200)
committerGuido Günther <agx@sigxcpu.org>
Sat, 24 Oct 2009 17:56:40 +0000 (19:56 +0200)
gbp/command_wrappers.py

index 1a966c1..cd36bf5 100644 (file)
@@ -195,6 +195,7 @@ class GitCommand(Command):
     "Mother/Father of all git commands"
     def __init__(self, cmd, args=[], **kwargs):
         Command.__init__(self, 'git', [cmd] + args, **kwargs)
+        self.run_error = "Couldn't run git %s" % cmd
 
 
 class GitInit(GitCommand):
@@ -246,6 +247,15 @@ class GitPull(GitCommand):
         self.run_error = 'Couldn\'t pull "%s" to "%s"' % (branch, repo)
 
 
+class GitFetch(GitCommand):
+    """Wrap git fetch"""
+    def __init__(self, remote = None):
+        opts = []
+        if remote:
+            opts += [remote]
+        GitCommand.__init__(self, 'fetch', opts)
+
+
 class GitMerge(GitCommand):
     """Wrap git merge"""
     def __init__(self, branch, verbose=False):