Skip to content

Navigation Menu

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 b2efa1b

Browse filesBrowse files
committed
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
1 parent 4486bcb commit b2efa1b
Copy full SHA for b2efa1b

File tree

3 files changed

+7
-3
lines changed
Filter options

3 files changed

+7
-3
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)

‎git/test/test_repo.py

Copy file name to clipboardExpand all lines: git/test/test_repo.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def test_is_dirty_with_path(self, rwrepo):
310310
assert rwrepo.is_dirty(path="git") is True
311311
assert rwrepo.is_dirty(path="doc") is False
312312

313-
rwrepo.git.add(osp.join("git", "util.py"))
313+
rwrepo.git.add(Git.polish_url(osp.join("git", "util.py")))
314314
assert rwrepo.is_dirty(index=False, path="git") is False
315315
assert rwrepo.is_dirty(path="git") is True
316316

0 commit comments

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