Skip to content

Commit 297cd26

Browse files
committed
review
1 parent 5fd795a commit 297cd26

1 file changed

Lines changed: 9 additions & 16 deletions

File tree

git/config.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,34 @@
1010
import abc
1111
import configparser as cp
1212
import fnmatch
13-
from functools import wraps
1413
import inspect
15-
from io import BufferedReader, IOBase
1614
import logging
1715
import os
1816
import os.path as osp
1917
import re
2018
import sys
21-
22-
from git.compat import defenc, force_text
23-
from git.util import LockFile
19+
from functools import wraps
20+
from io import BufferedReader, IOBase
2421

2522
# typing-------------------------------------------------------
26-
2723
from typing import (
24+
IO,
25+
TYPE_CHECKING,
2826
Any,
2927
Callable,
28+
Dict,
3029
Generic,
31-
IO,
3230
List,
33-
Dict,
3431
Sequence,
35-
TYPE_CHECKING,
3632
Tuple,
3733
TypeVar,
3834
Union,
3935
cast,
4036
)
4137

42-
from git.types import Lit_config_levels, ConfigLevels_Tup, PathLike, assert_never, _T
38+
from git.compat import defenc, force_text
39+
from git.types import _T, ConfigLevels_Tup, Lit_config_levels, PathLike, assert_never
40+
from git.util import LockFile
4341

4442
if TYPE_CHECKING:
4543
from io import BytesIO
@@ -956,12 +954,7 @@ def _string_to_value(self, valuestr: str) -> Union[int, float, str, bool]:
956954
continue
957955
# END for each numeric type
958956

959-
# Try boolean values as git uses them. git accepts yes/no and on/off as
960-
# well as true/false (git_parse_maybe_bool_text in parse.c), and so does
961-
# ConfigParser.getboolean on this class, so only get_value lagged behind.
962-
# Leaving them as strings was worse than merely inexact: "no" and "off"
963-
# are non-empty, so a caller testing the result got True for a value git
964-
# reads as false.
957+
# Try boolean values as git uses them.
965958
vl = valuestr.lower()
966959
if vl in ("false", "no", "off"):
967960
return False

0 commit comments

Comments
 (0)