diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-01-08 12:10:49 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-01-08 12:10:49 +0100 |
commit | 46889d1dce4506813206a8004f6c3e514f22b679 (patch) | |
tree | a3479e8d00f8b4586f85f400855df9d96520ce38 /git/remote.py | |
parent | de4cfcc4a1fcb24b72a31c5feff8c67d2ff930fc (diff) | |
download | gitpython-46889d1dce4506813206a8004f6c3e514f22b679.tar.gz |
Auto-update odb caches after fetch or pull.
Fixes #34
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 ce0ed363..1500f3d1 100644 --- a/git/remote.py +++ b/git/remote.py @@ -610,7 +610,9 @@ class Remote(LazyMixin, Iterable): args = [refspec] proc = self.repo.git.fetch(self, *args, with_extended_output=True, as_process=True, v=True, **kwargs) - return self._get_fetch_info_from_stderr(proc, progress or RemoteProgress()) + res = self._get_fetch_info_from_stderr(proc, progress or RemoteProgress()) + self.repo.odb.update_cache() + return res def pull(self, refspec=None, progress=None, **kwargs): """Pull changes from the given branch, being the same as a fetch followed @@ -622,7 +624,9 @@ class Remote(LazyMixin, Iterable): :return: Please see 'fetch' method """ 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) - return self._get_fetch_info_from_stderr(proc, progress or RemoteProgress()) + res = self._get_fetch_info_from_stderr(proc, progress or RemoteProgress()) + self.repo.odb.update_cache() + return res def push(self, refspec=None, progress=None, **kwargs): """Push changes from source branch in refspec to target branch in refspec. |