Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitedf9fc5

Browse files
committed
Git: guard against passing False to git commands
git does not accept commands of the form:git cmd --xx=Falseorgit cmd -xFalseThis patch prevents transform_kwargs from producingcommand lines with those values.This adds some flexibility/syntactic sugar for callerssince they can then assume that kwargs with a False valueare not passed to git commands.Signed-off-by: David Aguilar <davvid@gmail.com>
1 parentbf20839 commitedf9fc5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎lib/git/cmd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ def transform_kwargs(self, **kwargs):
132132
iflen(k)==1:
133133
ifvisTrue:
134134
args.append("-%s"%k)
135-
else:
135+
eliftype(v)isnotbool:
136136
args.append("-%s%s"% (k,v))
137137
else:
138138
ifvisTrue:
139139
args.append("--%s"%dashify(k))
140-
else:
140+
eliftype(v)isnotbool:
141141
args.append("--%s=%s"% (dashify(k),v))
142142
returnargs
143143

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp