Skip to content

Commit 0429bc3

Browse files
committed
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.
1 parent 7052136 commit 0429bc3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

git/config.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,13 @@ def get_value(self, section, option, default=None):
549549
return valuestr
550550

551551
def _value_to_string(self, value):
552-
if isinstance(value, (int, float, bool)):
552+
# git expects bool to be lower case true or false
553+
if isinstance(value, bool):
554+
if value:
555+
return 'true'
556+
else:
557+
return 'false'
558+
if isinstance(value, (int, float)):
553559
return str(value)
554560
return force_text(value)
555561

0 commit comments

Comments
 (0)