Skip to content

Commit ccb653d

Browse files
committed
Merge pull request #402 from rrei/master
Remove assertion over fetch refspec when explicitly specified Fixes #396
2 parents 20a338f + e61e320 commit ccb653d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

git/remote.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,9 @@ def fetch(self, refspec=None, progress=None, **kwargs):
644644
:note:
645645
As fetch does not provide progress information to non-ttys, we cannot make
646646
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()
648650
kwargs = add_progress(kwargs, self.repo.git, progress)
649651
if isinstance(refspec, list):
650652
args = refspec
@@ -666,7 +668,9 @@ def pull(self, refspec=None, progress=None, **kwargs):
666668
:param progress: see 'push' method
667669
:param kwargs: Additional arguments to be passed to git-pull
668670
: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()
670674
kwargs = add_progress(kwargs, self.repo.git, progress)
671675
proc = self.repo.git.pull(self, refspec, with_stdout=False, as_process=True, v=True, **kwargs)
672676
res = self._get_fetch_info_from_stderr(proc, progress or RemoteProgress())

0 commit comments

Comments
 (0)