Skip to content

Commit e0714f6

Browse files
committed
Improve parsing of insecure option
According to the git-config manpage, a boolean option may have the following formats: When a variable is said to take a boolean value, many synonyms are accepted for true and false; these are all case-insensitive. true Boolean true can be spelled as yes, on, true, or 1. Also, a variable defined without = <value> is taken as true. false Boolean false can be spelled as no, off, false, or 0. This implements every value of true except if its just the variable without any value. Everything else will be parsed as false.
1 parent 65ba246 commit e0714f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git_repo/services/service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def __init__(self, r=None, c=None):
156156
c.get('privatekey', None))))
157157
self._alias = c.get('alias', self.name)
158158
self.fqdn = c.get('fqdn', self.fqdn)
159-
self.insecure = c.get('insecure', False)
159+
self.insecure = c.get('insecure', 'false').lower() in ('on', 'true', 'yes', '1')
160160

161161
# if service has a repository configured, connect
162162
if r:

0 commit comments

Comments
 (0)