diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-01-08 12:19:56 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-01-08 12:22:29 +0100 |
commit | e40ad6369bc74d01af4dc41d3a9b8e25ac2aa01e (patch) | |
tree | 367475d2f3518f7a268710805d3415b3c1e11efe /git/remote.py | |
parent | 46889d1dce4506813206a8004f6c3e514f22b679 (diff) | |
download | gitpython-e40ad6369bc74d01af4dc41d3a9b8e25ac2aa01e.tar.gz |
Fixed PY3 support.
Apparently, thanks to an incorrect version check, PY3 ended up using
a git command object database by default. This is now fixed.
Additionally, the update_cache code was adjusted to check for method-existence,
as it's valid to use object databases which simply don't have a
caching mechanism (like the git command object database)
Diffstat (limited to 'git/remote.py')
-rw-r--r-- | git/remote.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/git/remote.py b/git/remote.py index 1500f3d1..746a7819 100644 --- a/git/remote.py +++ b/git/remote.py @@ -611,7 +611,8 @@ class Remote(LazyMixin, Iterable): proc = self.repo.git.fetch(self, *args, with_extended_output=True, as_process=True, v=True, **kwargs) res = self._get_fetch_info_from_stderr(proc, progress or RemoteProgress()) - self.repo.odb.update_cache() + if hasattr(self.repo.odb, 'update_cache'): + self.repo.odb.update_cache() return res def pull(self, refspec=None, progress=None, **kwargs): @@ -625,7 +626,8 @@ class Remote(LazyMixin, Iterable): kwargs = add_progress(kwargs, self.repo.git, progress) proc = self.repo.git.pull(self, refspec, with_extended_output=True, as_process=True, v=True, **kwargs) res = self._get_fetch_info_from_stderr(proc, progress or RemoteProgress()) - self.repo.odb.update_cache() + if hasattr(self.repo.odb, 'update_cache'): + self.repo.odb.update_cache() return res def push(self, refspec=None, progress=None, **kwargs): |