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

Appearance settings

Commit daa3f35

Browse filesBrowse files
FrNecasByron
authored andcommitted
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 8020433 commit daa3f35
Copy full SHA for daa3f35

2 files changed

+2-1Lines changed: 2 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎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

Collapse file

‎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.