summaryrefslogtreecommitdiff
path: root/git/repo/fun.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-10 19:20:22 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-10 19:20:22 +0100
commit6e8aa9b0aefc30ee5807c2b2cf433a38555b7e0b (patch)
tree21085a6a7f94d6362e995bd3fe1cb77e28be36ed /git/repo/fun.py
parent96c6ab4f7572fd5ca8638f3cb6e342d5000955e7 (diff)
downloadgitpython-6e8aa9b0aefc30ee5807c2b2cf433a38555b7e0b.tar.gz
Repo.init() now supports paths with a '~' in it, or environment variables in general.
Fixes #83
Diffstat (limited to 'git/repo/fun.py')
-rw-r--r--git/repo/fun.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/git/repo/fun.py b/git/repo/fun.py
index a0dc5ce9..1ee11ffc 100644
--- a/git/repo/fun.py
+++ b/git/repo/fun.py
@@ -19,7 +19,7 @@ from gitdb.util import (
from git.compat import xrange
-__all__ = ('rev_parse', 'is_git_dir', 'touch', 'find_git_dir', 'name_to_object', 'short_to_long', 'deref_tag',
+__all__ = ('rev_parse', 'is_git_dir', 'touch', 'find_git_dir', 'name_to_object', 'short_to_long', 'deref_tag',
'to_commit')
@@ -53,8 +53,10 @@ def find_git_dir(d):
pass
else:
if content.startswith('gitdir: '):
- d = join(dirname(d), content[8:])
- return find_git_dir(d)
+ path = content[8:]
+ if not os.path.isabs(path):
+ path = join(dirname(d), path)
+ return find_git_dir(path)
# end handle exception
return None