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

Commit5b27339

Browse files
FrNecasSebastian Thiel
authored and
Sebastian Thiel
committed
Fix Git.transform_kwarg
Kwargs were not transformed correctly if a value was set to 0 due towrong if condition.Signed-off-by: František Nečas <fifinecas@seznam.cz>
1 parent859ad04 commit5b27339

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

‎git/cmd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ def transform_kwarg(self, name, value, split_single_char_options):
893893
else:
894894
ifvalueisTrue:
895895
return ["--%s"%dashify(name)]
896-
elifvaluenotin (False,None):
896+
elifvalueisnotFalseandvalueisnotNone:
897897
return ["--%s=%s"% (dashify(name),value)]
898898
return []
899899

‎git/test/test_git.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def test_it_transforms_kwargs_into_git_command_arguments(self):
8686

8787
assert_equal(["--max-count"],self.git.transform_kwargs(**{'max_count':True}))
8888
assert_equal(["--max-count=5"],self.git.transform_kwargs(**{'max_count':5}))
89+
assert_equal(["--max-count=0"],self.git.transform_kwargs(**{'max_count':0}))
8990
assert_equal([],self.git.transform_kwargs(**{'max_count':None}))
9091

9192
# Multiple args are supported by using lists/tuples

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp