summaryrefslogtreecommitdiff
path: root/lib/git/cmd.py
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2008-05-31 23:01:17 -0700
committerDavid Aguilar <davvid@gmail.com>2008-05-31 23:01:17 -0700
commit6e1be3032d521e3bf2f49fc87f82c8f978079ea6 (patch)
tree1be5bc0b32a0ce2541bb072ba790b7a9822a02ea /lib/git/cmd.py
parenteba67171bf6ea653dfb6a6ae288f3c1d10829870 (diff)
downloadgitpython-6e1be3032d521e3bf2f49fc87f82c8f978079ea6.tar.gz
Git: guard against passing False to git commands
git does not accept commands of the form: git cmd --xx=False or git cmd -xFalse This patch prevents transform_kwargs from producing command lines with those values. This adds some flexibility/syntactic sugar for callers since they can then assume that kwargs with a False value are not passed to git commands. Signed-off-by: David Aguilar <davvid@gmail.com>
Diffstat (limited to 'lib/git/cmd.py')
-rw-r--r--lib/git/cmd.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/git/cmd.py b/lib/git/cmd.py
index ac449e91..85d72353 100644
--- a/lib/git/cmd.py
+++ b/lib/git/cmd.py
@@ -132,12 +132,12 @@ class Git(MethodMissingMixin):
if len(k) == 1:
if v is True:
args.append("-%s" % k)
- else:
+ elif type(v) is not bool:
args.append("-%s%s" % (k, v))
else:
if v is True:
args.append("--%s" % dashify(k))
- else:
+ elif type(v) is not bool:
args.append("--%s=%s" % (dashify(k), v))
return args