Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitb2efa1b

Browse 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, justa replace \-->/ on a relative(!) path to make cygwin-git to work.- REGRESSION `test_git_submodules_and_add_sm_with_new_commit` asks foruser/email settings.- Cygwin TCs failing: - PY2: err: 2, fail: 1 - PY3: err: 2, fail: 1
1 parent4486bcb commitb2efa1b

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

‎git/repo/base.py

Lines 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-
ifpathandGit.is_cygwin():
112+
ifGit.is_cygwin():
113113
path=decygpath(path)
114114

115115
epath=_expand_path(pathoros.getcwd())

‎git/repo/fun.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
fromgit.excimportWorkTreeRepositoryUnsupported
77
fromgit.objectsimportObject
88
fromgit.refsimportSymbolicReference
9-
fromgit.utilimporthex_to_bin,bin_to_hex
9+
fromgit.utilimporthex_to_bin,bin_to_hex,decygpath
1010
fromgitdb.excimport (
1111
BadObject,
1212
BadName,
1313
)
1414

1515
importos.pathasosp
16+
fromgit.cmdimportGit
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
ifcontent.startswith('gitdir: '):
6162
path=content[8:]
63+
ifGit.is_cygwin():
64+
## Cygwin creates submodules prefixed with `/cygdrive/...` suffixes.
65+
path=decygpath(path)
6266
ifnotosp.isabs(path):
6367
path=osp.join(osp.dirname(d),path)
6468
returnfind_git_dir(path)

‎git/test/test_repo.py

Lines 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
assertrwrepo.is_dirty(path="git")isTrue
311311
assertrwrepo.is_dirty(path="doc")isFalse
312312

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp