diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2016-04-14 07:42:57 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2016-04-14 07:42:57 +0200 |
commit | ccb653d655a7bf150049df079622f67fbfd83a28 (patch) | |
tree | 73ac5ab921c5d201c00a7a411ac735d3d8e5431f /git/remote.py | |
parent | 20a338ff049e7febe97411a6dc418a02ec11eefa (diff) | |
parent | e61e3200d5c9c185a7ab70b2836178ae8d998c17 (diff) | |
download | gitpython-ccb653d655a7bf150049df079622f67fbfd83a28.tar.gz |
Merge pull request #402 from rrei/master
Remove assertion over fetch refspec when explicitly specified
Fixes #396
Diffstat (limited to 'git/remote.py')
-rw-r--r-- | git/remote.py | 8 |
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()) |