Ignore the git-config exit code
authorCatalin Marinas <catalin.marinas@gmail.com>
Sat, 17 Oct 2009 21:52:33 +0000 (22:52 +0100)
committerCatalin Marinas <cmarinas@toshiba-laptop.(none)>
Sat, 17 Oct 2009 22:25:19 +0000 (23:25 +0100)
The stgit.config code dumps a stack trace if git-config returns an error
(when, for example, there is no ~/.gitconfig file).

Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
stgit/config.py

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