summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrrei <rui.jorge.rei@googlemail.com>2016-03-29 00:16:28 +0100
committerrrei <rui.jorge.rei@googlemail.com>2016-03-29 00:16:28 +0100
commite61e3200d5c9c185a7ab70b2836178ae8d998c17 (patch)
treec38dafc4ff0d083e137fcc614dd422e96d8e9cc9
parentbfaf706d70c3c113b40ce1cbc4d11d73c7500d73 (diff)
downloadgitpython-e61e3200d5c9c185a7ab70b2836178ae8d998c17.tar.gz
Remove assertion over fetch refspec when explicitly specified
-rw-r--r--git/remote.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/git/remote.py b/git/remote.py
index 9848624b..0c993077 100644
--- a/git/remote.py
+++ b/git/remote.py
@@ -644,7 +644,9 @@ class Remote(LazyMixin, Iterable):
:note:
As fetch does not provide progress information to non-ttys, we cannot make
it available here unfortunately as in the 'push' method."""
- self._assert_refspec()
+ if refspec is None:
+ # No argument refspec, then ensure the repo's config has a fetch refspec.
+ self._assert_refspec()
kwargs = add_progress(kwargs, self.repo.git, progress)
if isinstance(refspec, list):
args = refspec
@@ -666,7 +668,9 @@ class Remote(LazyMixin, Iterable):
:param progress: see 'push' method
:param kwargs: Additional arguments to be passed to git-pull
:return: Please see 'fetch' method """
- self._assert_refspec()
+ if refspec is None:
+ # No argument refspec, then ensure the repo's config has a fetch refspec.
+ self._assert_refspec()
kwargs = add_progress(kwargs, self.repo.git, progress)
proc = self.repo.git.pull(self, refspec, with_stdout=False, as_process=True, v=True, **kwargs)
res = self._get_fetch_info_from_stderr(proc, progress or RemoteProgress())