From 6e8aa9b0aefc30ee5807c2b2cf433a38555b7e0b Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sat, 10 Jan 2015 19:20:22 +0100 Subject: Repo.init() now supports paths with a '~' in it, or environment variables in general. Fixes #83 --- git/repo/fun.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'git/repo/fun.py') 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 -- cgit v1.2.3