summaryrefslogtreecommitdiff
path: root/git/remote.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-08 12:19:56 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-08 12:22:29 +0100
commite40ad6369bc74d01af4dc41d3a9b8e25ac2aa01e (patch)
tree367475d2f3518f7a268710805d3415b3c1e11efe /git/remote.py
parent46889d1dce4506813206a8004f6c3e514f22b679 (diff)
downloadgitpython-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.py6
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):