summaryrefslogtreecommitdiff
path: root/lib/git/repo.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-11-10 15:10:45 +0100
committerSebastian Thiel <byronimo@gmail.com>2009-11-10 15:10:45 +0100
commit59b05d06c1babcc8cd1c541716ca25452056020a (patch)
tree081f5f723f8cc60cf1ab8f000fa0dba99c6f52a1 /lib/git/repo.py
parent1f4bc8ee9aeeec8bf7aa31c627e50761dd8bb2db (diff)
downloadgitpython-59b05d06c1babcc8cd1c541716ca25452056020a.tar.gz
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
Diffstat (limited to 'lib/git/repo.py')
-rw-r--r--lib/git/repo.py6
1 files changed, 4 insertions, 2 deletions
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)