| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -109,7 +109,7 @@ def __init__(self, path=None, odbt=DefaultDBType, search_parent_directories=Fals | |||
| 109 | 109 | :raise InvalidGitRepositoryError: | |
| 110 | 110 | :raise NoSuchPathError: | |
| 111 | 111 | :return: git.Repo """ | |
| 112 | - if path and Git.is_cygwin(): | ||
| 112 | + if Git.is_cygwin(): | ||
| 113 | 113 | path = decygpath(path) | |
| 114 | 114 | ||
| 115 | 115 | epath = _expand_path(path or os.getcwd()) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,13 +6,14 @@ | |||
| 6 | 6 | from git.exc import WorkTreeRepositoryUnsupported | |
| 7 | 7 | from git.objects import Object | |
| 8 | 8 | from git.refs import SymbolicReference | |
| 9 | - from git.util import hex_to_bin, bin_to_hex | ||
| 9 | + from git.util import hex_to_bin, bin_to_hex, decygpath | ||
| 10 | 10 | from gitdb.exc import ( | |
| 11 | 11 | BadObject, | |
| 12 | 12 | BadName, | |
| 13 | 13 | ) | |
| 14 | 14 | ||
| 15 | 15 | import os.path as osp | |
| 16 | + from git.cmd import Git | ||
| 16 | 17 | ||
| 17 | 18 | ||
| 18 | 19 | __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): | |||
| 59 | 60 | else: | |
| 60 | 61 | if content.startswith('gitdir: '): | |
| 61 | 62 | path = content[8:] | |
| 63 | + if Git.is_cygwin(): | ||
| 64 | + ## Cygwin creates submodules prefixed with `/cygdrive/...` suffixes. | ||
| 65 | + path = decygpath(path) | ||
| 62 | 66 | if not osp.isabs(path): | |
| 63 | 67 | path = osp.join(osp.dirname(d), path) | |
| 64 | 68 | return find_git_dir(path) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments