Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit46889d1

Browse files
committed
Auto-update odb caches after fetch or pull.
Fixesgitpython-developers#34
1 parentde4cfcc commit46889d1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

‎doc/source/changes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Changelog
66
================
77
* push/pull/fetch operations will not block anymore
88
* diff() can now properly detect renames, both in patch and raw format. Previously it only worked when create_patch was True.
9+
* repo.odb.update_cache() is now called automatically after fetch and pull operations. In case you did that in your own code, you might want to remove your line to prevent a double-update that causes unnecessary IO.
910
* A list of all fixed issues can be found here: https://github.com/gitpython-developers/GitPython/issues?q=milestone%3A%22v0.3.5+-+bugfixes%22+
1011

1112
0.3.4 - Python 3 Support

‎git/remote.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,9 @@ def fetch(self, refspec=None, progress=None, **kwargs):
610610
args= [refspec]
611611

612612
proc=self.repo.git.fetch(self,*args,with_extended_output=True,as_process=True,v=True,**kwargs)
613-
returnself._get_fetch_info_from_stderr(proc,progressorRemoteProgress())
613+
res=self._get_fetch_info_from_stderr(proc,progressorRemoteProgress())
614+
self.repo.odb.update_cache()
615+
returnres
614616

615617
defpull(self,refspec=None,progress=None,**kwargs):
616618
"""Pull changes from the given branch, being the same as a fetch followed
@@ -622,7 +624,9 @@ def pull(self, refspec=None, progress=None, **kwargs):
622624
:return: Please see 'fetch' method """
623625
kwargs=add_progress(kwargs,self.repo.git,progress)
624626
proc=self.repo.git.pull(self,refspec,with_extended_output=True,as_process=True,v=True,**kwargs)
625-
returnself._get_fetch_info_from_stderr(proc,progressorRemoteProgress())
627+
res=self._get_fetch_info_from_stderr(proc,progressorRemoteProgress())
628+
self.repo.odb.update_cache()
629+
returnres
626630

627631
defpush(self,refspec=None,progress=None,**kwargs):
628632
"""Push changes from source branch in refspec to target branch in refspec.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp