Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7fa6a8d

Browse filesBrowse files
committed
cygwin, gitpython-developers#533: FIX submodules detection
+ Decygpath sm's `.git` file contents.
1 parent efbedff commit 7fa6a8d
Copy full SHA for 7fa6a8d

File tree

Expand file treeCollapse file tree

2 files changed

+6
-2
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-2
lines changed

‎git/repo/base.py

Copy file name to clipboardExpand all lines: git/repo/base.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def __init__(self, path=None, odbt=DefaultDBType, search_parent_directories=Fals
109109
:raise InvalidGitRepositoryError:
110110
:raise NoSuchPathError:
111111
:return: git.Repo """
112-
if path and Git.is_cygwin():
112+
if Git.is_cygwin():
113113
path = decygpath(path)
114114

115115
epath = _expand_path(path or os.getcwd())

‎git/repo/fun.py

Copy file name to clipboardExpand all lines: git/repo/fun.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
from git.exc import WorkTreeRepositoryUnsupported
77
from git.objects import Object
88
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
1010
from gitdb.exc import (
1111
BadObject,
1212
BadName,
1313
)
1414

1515
import os.path as osp
16+
from git.cmd import Git
1617

1718

1819
__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):
5960
else:
6061
if content.startswith('gitdir: '):
6162
path = content[8:]
63+
if Git.is_cygwin():
64+
## Cygwin creates submodules prefixed with `/cygdrive/...` suffixes.
65+
path = decygpath(path)
6266
if not osp.isabs(path):
6367
path = osp.join(osp.dirname(d), path)
6468
return find_git_dir(path)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.