diff options
author | yobmod <yobmod@gmail.com> | 2021-05-13 22:16:54 +0100 |
---|---|---|
committer | yobmod <yobmod@gmail.com> | 2021-05-13 22:16:54 +0100 |
commit | cfa37825b011af682bc12047b82d8cec0121fe4e (patch) | |
tree | 109a09d1b7a2365d64399a4dc5d3c4d3155dc61c /git/util.py | |
parent | 96c43652c9f5b11b611e1aca0a6d67393e9e38c1 (diff) | |
download | gitpython-cfa37825b011af682bc12047b82d8cec0121fe4e.tar.gz |
revert util.expand_path() due to regression
Diffstat (limited to 'git/util.py')
-rw-r--r-- | git/util.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/git/util.py b/git/util.py index 30018310..ef8ea8d6 100644 --- a/git/util.py +++ b/git/util.py @@ -382,13 +382,10 @@ def expand_path(p: PathLike, expand_vars: bool = ...) -> str: def expand_path(p: Union[None, PathLike], expand_vars: bool = True) -> Optional[str]: try: - if p is not None: - p_out = osp.expanduser(p) - if expand_vars: - p_out = osp.expandvars(p_out) - return osp.normpath(osp.abspath(p_out)) - else: - return None + p = osp.expanduser(p) # type: ignore + if expand_vars: + p = osp.expandvars(p) # type: ignore + return osp.normpath(osp.abspath(p)) # type: ignore except Exception: return None |