summaryrefslogtreecommitdiff
path: root/git/repo/fun.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2016-10-22 15:52:26 +0200
committerGitHub <noreply@github.com>2016-10-22 15:52:26 +0200
commit4754fa194360b4648a26b93cdff60d7906eb7f7d (patch)
tree23445fd34bf4b15f125c3ded00f6e6e8079058ff /git/repo/fun.py
parentcaa0ea7a0893fe90ea043843d4e6ad407126d7b8 (diff)
parent5fac8d40f535ec8f3d1cf2187fbbe3418d82cf62 (diff)
downloadgitpython-4754fa194360b4648a26b93cdff60d7906eb7f7d.tar.gz
Merge pull request #537 from ankostis/exp_git_dir
FIX #535: expand also GIT_DIR var on Repo-construction
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 c5a8a52b..39e55880 100644
--- a/git/repo/fun.py
+++ b/git/repo/fun.py
@@ -16,7 +16,7 @@ import os.path as osp
from git.cmd import Git
-__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_submodule_git_dir', 'name_to_object', 'short_to_long', 'deref_tag',
'to_commit')
@@ -47,7 +47,8 @@ def is_git_dir(d):
return False
-def find_git_dir(d):
+def find_submodule_git_dir(d):
+ """Search for a submodule repo."""
if is_git_dir(d):
return d
@@ -60,12 +61,13 @@ def find_git_dir(d):
else:
if content.startswith('gitdir: '):
path = content[8:]
+
if Git.is_cygwin():
## Cygwin creates submodules prefixed with `/cygdrive/...` suffixes.
path = decygpath(path)
if not osp.isabs(path):
path = osp.join(osp.dirname(d), path)
- return find_git_dir(path)
+ return find_submodule_git_dir(path)
# end handle exception
return None