[StGIT PATCH 1/5] Fix config caching so that get, set, get works

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The config caching was never invalidated or updated, which caused the
two gets to always return the same value regardless of the value
passed to set.

Signed-off-by: Karl Hasselström <kha@xxxxxxxxxxx>
---

 stgit/config.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/stgit/config.py b/stgit/config.py
index 79cd12f..2fd1273 100644
--- a/stgit/config.py
+++ b/stgit/config.py
@@ -99,12 +99,15 @@ class GitConfig:
 
     def rename_section(self, from_name, to_name):
         self.__run('git-repo-config --rename-section', [from_name, to_name])
+        self.__cache.clear()
 
     def set(self, name, value):
         self.__run('git-repo-config', [name, value])
+        self.__cache[name] = value
 
     def unset(self, name):
         self.__run('git-repo-config --unset', [name])
+        self.__cache[name] = None
 
     def sections_matching(self, regexp):
         """Takes a regexp with a single group, matches it against all

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux