Skip to content

git expects boolean value to be lower case #578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 16 commits into from
Closed
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