Skip to content

Navigation Menu

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

Appearance settings

Commit 5b27339

Browse filesBrowse 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 to wrong if condition. Signed-off-by: František Nečas <fifinecas@seznam.cz>
1 parent 859ad04 commit 5b27339
Copy full SHA for 5b27339

File tree

2 files changed

+2
-1
lines changed
Filter options

2 files changed

+2
-1
lines changed

‎git/cmd.py

Copy file name to clipboardExpand all lines: git/cmd.py
+1-1Lines 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
if value is True:
895895
return ["--%s" % dashify(name)]
896-
elif value not in (False, None):
896+
elif value is not False and value is not None:
897897
return ["--%s=%s" % (dashify(name), value)]
898898
return []
899899

‎git/test/test_git.py

Copy file name to clipboardExpand all lines: git/test/test_git.py
+1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.