Skip to content

Commit cfa3782

Browse files
committed
revert util.expand_path() due to regression
1 parent 96c4365 commit cfa3782

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

Diff for: git/util.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -382,13 +382,10 @@ def expand_path(p: PathLike, expand_vars: bool = ...) -> str:
382382

383383
def expand_path(p: Union[None, PathLike], expand_vars: bool = True) -> Optional[str]:
384384
try:
385-
if p is not None:
386-
p_out = osp.expanduser(p)
387-
if expand_vars:
388-
p_out = osp.expandvars(p_out)
389-
return osp.normpath(osp.abspath(p_out))
390-
else:
391-
return None
385+
p = osp.expanduser(p) # type: ignore
386+
if expand_vars:
387+
p = osp.expandvars(p) # type: ignore
388+
return osp.normpath(osp.abspath(p)) # type: ignore
392389
except Exception:
393390
return None
394391

0 commit comments

Comments
 (0)