We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2abba30 commit b345d6cCopy full SHA for b345d6c
1 file changed
git-p4.py
@@ -560,13 +560,16 @@ def gitBranchExists(branch):
560
return proc.wait() == 0;
561
562
_gitConfig = {}
563
-def gitConfig(key, args = None): # set args to "--bool", for instance
+
564
+def gitConfig(key, args=None): # set args to "--bool", for instance
565
if not _gitConfig.has_key(key):
- argsFilter = ""
566
- if args != None:
567
- argsFilter = "%s " % args
568
- cmd = "git config %s%s" % (argsFilter, key)
569
- _gitConfig[key] = read_pipe(cmd, ignore_error=True).strip()
+ cmd = [ "git", "config" ]
+ if args:
+ assert(args == "--bool")
+ cmd.append(args)
570
+ cmd.append(key)
571
+ s = read_pipe(cmd, ignore_error=True)
572
+ _gitConfig[key] = s.strip()
573
return _gitConfig[key]
574
575
def gitConfigList(key):
0 commit comments