Look up *key* and parse its value as a boolean as per the git-config rules. Return a boolean value (True or False). Truthy values are: 'true', 1, 'on' or 'yes'. Falsy values are: 'false', 0, 'off' and 'no'
(self, key: str | bytes)
| 220 | check_error(err) |
| 221 | |
| 222 | def get_bool(self, key: str | bytes) -> bool: |
| 223 | """Look up *key* and parse its value as a boolean as per the git-config |
| 224 | rules. Return a boolean value (True or False). |
| 225 | |
| 226 | Truthy values are: 'true', 1, 'on' or 'yes'. Falsy values are: 'false', |
| 227 | 0, 'off' and 'no' |
| 228 | """ |
| 229 | |
| 230 | entry = self._get_entry(key) |
| 231 | res = ffi.new('int *') |
| 232 | err = C.git_config_parse_bool(res, entry.c_value) |
| 233 | check_error(err) |
| 234 | |
| 235 | return res[0] != 0 |
| 236 | |
| 237 | def get_int(self, key: bytes | str) -> int: |
| 238 | """Look up *key* and parse its value as an integer as per the git-config |