diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2017-09-28 15:17:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-28 15:17:25 +0200 |
commit | 58998fb2dd6a1cad5faffdc36ae536ee6b04e3d2 (patch) | |
tree | 4f5c342b1c20b23a5bc73eb74855c4bb81f2c197 /git/util.py | |
parent | 251128d41cdf39a49468ed5d997cc1640339ccbc (diff) | |
parent | 2af601d5800a39ab04e9fe6cf22ef7b917ab5d67 (diff) | |
download | gitpython-58998fb2dd6a1cad5faffdc36ae536ee6b04e3d2.tar.gz |
Merge branch 'master' into master
Diffstat (limited to 'git/util.py')
-rw-r--r-- | git/util.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/git/util.py b/git/util.py index 5553a0aa..5baeee91 100644 --- a/git/util.py +++ b/git/util.py @@ -340,6 +340,16 @@ def finalize_process(proc, **kwargs): ## TODO: No close proc-streams?? proc.wait(**kwargs) + +def expand_path(p, expand_vars=True): + try: + p = osp.expanduser(p) + if expand_vars: + p = osp.expandvars(p) + return osp.normpath(osp.abspath(p)) + except: + return None + #} END utilities #{ Classes |