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 a2d248b

Browse filesBrowse files
committed
cygwin, #533: polish abs-paths in git 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 parent 3b1cfcc commit a2d248b
Copy full SHA for a2d248b

File tree

3 files changed

+4
-2
lines changed
Filter options

3 files changed

+4
-2
lines changed

‎git/test/test_diff.py

Copy file name to clipboardExpand all lines: git/test/test_diff.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
NULL_TREE,
2626
)
2727
import ddt
28+
from git.cmd import Git
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
with open(fp, 'w') as fs:
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
with open(fp, 'w') as fs:

‎git/test/test_submodule.py

Copy file name to clipboardExpand all lines: git/test/test_submodule.py
+1-1Lines 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
with open(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

Copy file name to clipboardExpand all lines: git/util.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ def _cygexpath(drive, path):
264264

265265

266266
def cygpath(path):
267+
"""Use :meth:`git.cmd.Git.polish_url()` instead, that works on any environment."""
267268
if not path.startswith(('/cygdrive', '//')):
268269
for regex, parser, recurse in _cygpath_parsers:
269270
match = regex.match(path)

0 commit comments

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