summaryrefslogtreecommitdiff
path: root/git/repo/fun.py
diff options
context:
space:
mode:
authorKostis Anagnostopoulos <ankostis@gmail.com>2016-10-19 16:16:24 +0200
committerKostis Anagnostopoulos <ankostis@gmail.com>2016-10-19 17:02:35 +0200
commit76ac61a2b4bb10c8434a7d6fc798b115b4b7934d (patch)
tree763993b8d2c46a425db36e12d941db79866f7de7 /git/repo/fun.py
parentcc77e6b2862733a211c55cf29cc7a83c36c27919 (diff)
parent9d5d143f72e4d588e3a0abb2ab82fa5a2c35e8aa (diff)
downloadgitpython-76ac61a2b4bb10c8434a7d6fc798b115b4b7934d.tar.gz
Merge with latest branch 'exp_git_dir'
Conflicts: git/repo/base.py git/repo/fun.py git/test/test_submodule.py
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 7ea45e6b..41e7ad3f 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