Pass "git config" flags in the right order
authorKarl Hasselström <kha@treskal.com>
Fri, 29 May 2009 21:33:50 +0000 (22:33 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Fri, 29 May 2009 21:33:50 +0000 (22:33 +0100)
New enough gits accept the --null and --list flags in any order, but
older gits want --null before --list. So do it the way that's fine
with everyone.

I think (but haven't verified) that git started to accept the flags in
any order after commit d64ec16c2af4ddcf3985d11d5dc28a15db181de5 ("git
config: reorganize to use parseopt") by Felipe Contreras on
2009-02-21, first released in git v1.6.3.

Signed-off-by: Karl Hasselström <kha@treskal.com>
stgit/config.py

index c40756c..dc9c9eb 100644 (file)
@@ -48,7 +48,7 @@ class GitConfig:
         if self.__cache is not None:
             return
         self.__cache = {}
         if self.__cache is not None:
             return
         self.__cache = {}
-        lines = Run('git', 'config', '--list', '--null').raw_output()
+        lines = Run('git', 'config', '--null', '--list').raw_output()
         for line in filter(None, lines.split('\0')):
             key, value = line.split('\n', 1)
             self.__cache.setdefault(key, []).append(value)
         for line in filter(None, lines.split('\0')):
             key, value = line.split('\n', 1)
             self.__cache.setdefault(key, []).append(value)