1616 IterableList ,
1717 RemoteProgress
1818 )
19-
19+ from git . db . interface import TransportDB
2020from refs import RemoteReference
2121
2222import os
@@ -53,6 +53,16 @@ def __init__(self, repo, name):
5353
5454 :param repo: The repository we are a remote of
5555 :param name: the name of the remote, i.e. 'origin'"""
56+ if not hasattr (repo , 'git' ):
57+ # note: at some point we could just create a git command instance ourselves
58+ # but lets just be lazy for now
59+ raise AssertionError ("Require repository to provide a git command instance currently" )
60+ #END assert git cmd
61+
62+ if not isinstance (repo , TransportDB ):
63+ raise AssertionError ("Require TransportDB interface implementation" )
64+ #END verify interface
65+
5666 self .repo = repo
5767 self .name = name
5868
@@ -228,8 +238,7 @@ def fetch(self, refspec=None, progress=None, **kwargs):
228238 :note:
229239 As fetch does not provide progress information to non-ttys, we cannot make
230240 it available here unfortunately as in the 'push' method."""
231- proc = self .repo .git .fetch (self , refspec , with_extended_output = True , as_process = True , v = True , ** kwargs )
232- return self ._get_fetch_info_from_stderr (proc , progress or RemoteProgress ())
241+ return self .repo .fetch (self .name , refspec , progress , ** kwargs )
233242
234243 def pull (self , refspec = None , progress = None , ** kwargs ):
235244 """Pull changes from the given branch, being the same as a fetch followed
@@ -239,8 +248,7 @@ def pull(self, refspec=None, progress=None, **kwargs):
239248 :param progress: see 'push' method
240249 :param kwargs: Additional arguments to be passed to git-pull
241250 :return: Please see 'fetch' method """
242- proc = self .repo .git .pull (self , refspec , with_extended_output = True , as_process = True , v = True , ** kwargs )
243- return self ._get_fetch_info_from_stderr (proc , progress or RemoteProgress ())
251+ return self .repo .pull (self .name , refspec , progress , ** kwargs )
244252
245253 def push (self , refspec = None , progress = None , ** kwargs ):
246254 """Push changes from source branch in refspec to target branch in refspec.
@@ -260,8 +268,7 @@ def push(self, refspec=None, progress=None, **kwargs):
260268 in their flags.
261269 If the operation fails completely, the length of the returned IterableList will
262270 be null."""
263- proc = self .repo .git .push (self , refspec , porcelain = True , as_process = True , ** kwargs )
264- return self ._get_push_info (proc , progress or RemoteProgress ())
271+ return self .repo .push (self .name , refspec , progress , ** Kwargs )
265272
266273 @property
267274 def config_reader (self ):
0 commit comments