Skip to content

Commit 9be148c

Browse files
authored
BUG: Use Cygwin paths for Cygwin git
1 parent f990852 commit 9be148c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: git/repo/fun.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from git.exc import WorkTreeRepositoryUnsupported
88
from git.objects import Object
99
from git.refs import SymbolicReference
10-
from git.util import hex_to_bin, bin_to_hex, decygpath
10+
from git.util import hex_to_bin, bin_to_hex, cygpath
1111
from gitdb.exc import (
1212
BadObject,
1313
BadName,
@@ -109,7 +109,9 @@ def find_submodule_git_dir(d: "PathLike") -> Optional["PathLike"]:
109109

110110
if Git.is_cygwin():
111111
## Cygwin creates submodules prefixed with `/cygdrive/...` suffixes.
112-
path = decygpath(path)
112+
# Cygwin git understands Cygwin paths much better than Windows ones
113+
# Also the Cygwin tests are assuming Cygwin paths.
114+
path = cygpath(path)
113115
if not osp.isabs(path):
114116
path = osp.normpath(osp.join(osp.dirname(d), path))
115117
return find_submodule_git_dir(path)

0 commit comments

Comments
 (0)