From 59b05d06c1babcc8cd1c541716ca25452056020a Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 10 Nov 2009 15:10:45 +0100 Subject: repo: may now be initialized from a path with envrionment variables. Previously it would consider such a path a relative one and handle it incorrectly --- lib/git/repo.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/git/repo.py') diff --git a/lib/git/repo.py b/lib/git/repo.py index d39f11d1..aba6cff0 100644 --- a/lib/git/repo.py +++ b/lib/git/repo.py @@ -66,7 +66,9 @@ class Repo(object): repo = Repo("/Users/mtrier/Development/git-python") repo = Repo("/Users/mtrier/Development/git-python.git") - + repo = Repo("~/Development/git-python.git") + repo = Repo("$REPOSITORIES/Development/git-python.git") + Raises InvalidGitRepositoryError or NoSuchPathError @@ -74,7 +76,7 @@ class Repo(object): ``git.Repo`` """ - epath = os.path.abspath(os.path.expanduser(path or os.getcwd())) + epath = os.path.abspath(os.path.expandvars(os.path.expanduser(path or os.getcwd()))) if not os.path.exists(epath): raise NoSuchPathError(epath) -- cgit v1.2.1