git-p4: return an empty list if a list config has no values
authorLars Schneider <larsxschneider@gmail.com>
Sat, 26 Sep 2015 07:55:00 +0000 (09:55 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sat, 3 Oct 2015 17:21:13 +0000 (10:21 -0700)
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-p4.py
index c99b077884756e01b697e1abf53e08482e6712c3..ae1e9ea52e1a61034f9e6b48d2ad25c10403a590 100755 (executable)
--- a/git-p4.py
+++ b/git-p4.py
@@ -638,6 +638,8 @@ def gitConfigList(key):
     if not _gitConfig.has_key(key):
         s = read_pipe(["git", "config", "--get-all", key], ignore_error=True)
         _gitConfig[key] = s.strip().split(os.linesep)
     if not _gitConfig.has_key(key):
         s = read_pipe(["git", "config", "--get-all", key], ignore_error=True)
         _gitConfig[key] = s.strip().split(os.linesep)
+        if _gitConfig[key] == ['']:
+            _gitConfig[key] = []
     return _gitConfig[key]
 
 def p4BranchesInGit(branchesAreInRemotes=True):
     return _gitConfig[key]
 
 def p4BranchesInGit(branchesAreInRemotes=True):