Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
git expects boolean value to be lower case
str(bool) returns capitialised True and False
that is not what git expects or compatible with
getboolean.
  • Loading branch information
barry-scott committed Feb 2, 2017
commit 0429bc3ff88071d11b6095aa69f0fb205ae40452
8 changes: 7 additions & 1 deletion git/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,13 @@ def get_value(self, section, option, default=None):
return valuestr

def _value_to_string(self, value):
if isinstance(value, (int, float, bool)):
# git expects bool to be lower case true or false
if isinstance(value, bool):
if value:
return 'true'
else:
return 'false'
if isinstance(value, (int, float)):
return str(value)
return force_text(value)

Expand Down