FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix Git.transform_kwarg by FrNecas · Pull Request #899 · gitpython-developers/GitPython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
2 changes: 1 addition & 1 deletion git/cmd.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ def transform_kwarg(self, name, value, split_single_char_options):
else:
if value is True:
return ["--%s" % dashify(name)]
elif value not in (False, None):
elif value is not False and value is not None:
return ["--%s=%s" % (dashify(name), value)]
return []

Expand Down
1 change: 1 addition & 0 deletions git/test/test_git.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def test_it_transforms_kwargs_into_git_command_arguments(self):

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

# Multiple args are supported by using lists/tuples
Expand Down

Back | FazBrowse Home | New Git URL