mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Allow callers to reset the git config cache
If commands modify the git config too rapidly we might not notice the .git/config file has been modified, as they could run in the same filesystem timestamp window and thus not cause a change on the config's mtime. This can cause repo to miss re-reading the config file after running a command. Allowing the cache to be flushed forces us to re-read the config. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
parent
c24c720b61
commit
98ea26b8d8
@ -71,6 +71,14 @@ class GitConfig(object):
|
|||||||
else:
|
else:
|
||||||
self._pickle = pickleFile
|
self._pickle = pickleFile
|
||||||
|
|
||||||
|
def ClearCache(self):
|
||||||
|
if os.path.exists(self._pickle):
|
||||||
|
os.remove(self._pickle)
|
||||||
|
self._cache_dict = None
|
||||||
|
self._section_dict = None
|
||||||
|
self._remotes = {}
|
||||||
|
self._branches = {}
|
||||||
|
|
||||||
def Has(self, name, include_defaults = True):
|
def Has(self, name, include_defaults = True):
|
||||||
"""Return true if this configuration file has the key.
|
"""Return true if this configuration file has the key.
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user