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

Commita2d248b

Browse files
committed
cygwin,#533: polish abs-paths ingit add commands
+ Modify TCs - no main-code changes.+ FIXed: + `TestSubmodule.test_git_submodules_and_add_sm_with_new_commit()` + TestDiff.test_diff_with_staged_file()- Cygwin TCs failing: - PY2: err: 12, fail: 2 - PY3: err: 11, fail: 2
1 parent3b1cfcc commita2d248b

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

‎git/test/test_diff.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
NULL_TREE,
2626
)
2727
importddt
28+
fromgit.cmdimportGit
2829

2930

3031
@ddt.ddt
@@ -56,7 +57,7 @@ def test_diff_with_staged_file(self, rw_dir):
5657
fp=os.path.join(rw_dir,'hello.txt')
5758
withopen(fp,'w')asfs:
5859
fs.write("hello world")
59-
r.git.add(fp)
60+
r.git.add(Git.polish_url(fp))
6061
r.git.commit(message="init")
6162

6263
withopen(fp,'w')asfs:

‎git/test/test_submodule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ def test_git_submodules_and_add_sm_with_new_commit(self, rwdir):
705705
fp=osp.join(smm.working_tree_dir,'empty-file')
706706
withopen(fp,'w'):
707707
pass
708-
smm.git.add(fp)
708+
smm.git.add(Git.polish_url(fp))
709709
smm.git.commit(m="new file added")
710710

711711
# submodules are retrieved from the current commit's tree, therefore we can't really get a new submodule

‎git/util.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ def _cygexpath(drive, path):
264264

265265

266266
defcygpath(path):
267+
"""Use :meth:`git.cmd.Git.polish_url()` instead, that works on any environment."""
267268
ifnotpath.startswith(('/cygdrive','//')):
268269
forregex,parser,recursein_cygpath_parsers:
269270
match=regex.match(path)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp