@@ -644,7 +644,9 @@ def fetch(self, refspec=None, progress=None, **kwargs):
644
644
:note:
645
645
As fetch does not provide progress information to non-ttys, we cannot make
646
646
it available here unfortunately as in the 'push' method."""
647
- self ._assert_refspec ()
647
+ if refspec is None :
648
+ # No argument refspec, then ensure the repo's config has a fetch refspec.
649
+ self ._assert_refspec ()
648
650
kwargs = add_progress (kwargs ,self .repo .git ,progress )
649
651
if isinstance (refspec ,list ):
650
652
args = refspec
@@ -666,7 +668,9 @@ def pull(self, refspec=None, progress=None, **kwargs):
666
668
:param progress: see 'push' method
667
669
:param kwargs: Additional arguments to be passed to git-pull
668
670
:return: Please see 'fetch' method """
669
- self ._assert_refspec ()
671
+ if refspec is None :
672
+ # No argument refspec, then ensure the repo's config has a fetch refspec.
673
+ self ._assert_refspec ()
670
674
kwargs = add_progress (kwargs ,self .repo .git ,progress )
671
675
proc = self .repo .git .pull (self ,refspec ,with_stdout = False ,as_process = True ,v = True ,** kwargs )
672
676
res = self ._get_fetch_info_from_stderr (proc ,progress or RemoteProgress ())