diff options
author | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-16 02:44:37 +0200 |
---|---|---|
committer | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-10-16 03:04:36 +0200 |
commit | b2efa1b19061ad6ed9d683ba98a88b18bff3bfd9 (patch) | |
tree | dcdafa0214e9d2eb84f285c4afddd056f65b1f00 /git/repo/fun.py | |
parent | 4486bcbbf49ad0eacf2d8229fb0e7e3432f440d9 (diff) | |
download | gitpython-b2efa1b19061ad6ed9d683ba98a88b18bff3bfd9.tar.gz |
cygwin, #533: FIX submodules detection (~10TCs fixed)
+ Decygpath sm's `.git` file contents.
+ Polish another path in `git add`; actually no main-code changes, just
a replace \-->/ on a relative(!) path to make cygwin-git to work.
- REGRESSION `test_git_submodules_and_add_sm_with_new_commit` asks for
user/email settings.
- Cygwin TCs failing:
- PY2: err: 2, fail: 1
- PY3: err: 2, fail: 1
Diffstat (limited to 'git/repo/fun.py')
-rw-r--r-- | git/repo/fun.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/git/repo/fun.py b/git/repo/fun.py index 5fe8682d..7ea45e6b 100644 --- a/git/repo/fun.py +++ b/git/repo/fun.py @@ -6,13 +6,14 @@ from git.compat import xrange from git.exc import WorkTreeRepositoryUnsupported from git.objects import Object from git.refs import SymbolicReference -from git.util import hex_to_bin, bin_to_hex +from git.util import hex_to_bin, bin_to_hex, decygpath from gitdb.exc import ( BadObject, BadName, ) 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', @@ -59,6 +60,9 @@ 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) |