aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Wiberg <kha@treskal.com>2009-08-24 10:28:33 +0200
committerKarl Wiberg <kha@treskal.com>2009-08-24 10:28:33 +0200
commitd34d6e351e9708f4a5ce519e508abbc418285b5e (patch)
treeec819ef0e8e53406a7c512c7a3f37cc6d561c638
parent525817dd5783b97dd955a723998fe25cecaf1440 (diff)
downloadstgit-d34d6e351e9708f4a5ce519e508abbc418285b5e.tar.gz
When reading a config value, pick the last value, not the first
When reading the config values, we save all values for a given key in a list, in the order we see them. Then, when asked for one value, we used to return the _first_ value in the list. But the correct thing to do in order to allow local configs (like the repository's .git/config) to override global configs (like ~/.gitconfig) is to return the _last_ value. Signed-off-by: Karl Wiberg <kha@treskal.com>
-rw-r--r--stgit/config.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/stgit/config.py b/stgit/config.py
index 6f84b10..bfb117d 100644
--- a/stgit/config.py
+++ b/stgit/config.py
@@ -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()