When reading a config value, pick the last value, not the first
[stgit] / stgit / config.py
index 4a6cb3b..bfb117d 100644 (file)
@@ -57,7 +57,7 @@ class GitConfig:
         self.load()
         if name not in self.__cache:
             self.__cache[name] = [self.__defaults.get(name, None)]
-        return self.__cache[name][0]
+        return self.__cache[name][-1]
 
     def getall(self, name):
         self.load()
@@ -94,8 +94,8 @@ class GitConfig:
         self.__cache[name] = value
 
     def unset(self, name):
-        Run('git', 'config', '--unset', name)
-        self.__cache[name] = None
+        Run('git', 'config', '--unset', name).run()
+        self.__cache[name] = [None]
 
     def sections_matching(self, regexp):
         """Takes a regexp with a single group, matches it against all