Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
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
  • Loading branch information
@ankostis
ankostis committed Oct 16, 2016
commit a2d248bb8362808121f6b6abfd316d83b65afa79
3 changes: 2 additions & 1 deletion git/test/test_diff.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -25,6 +25,7 @@
NULL_TREE,
)
importddt
fromgit.cmdimportGit


@ddt.ddt
Expand DownExpand Up@@ -56,7 +57,7 @@ def test_diff_with_staged_file(self, rw_dir):
fp=os.path.join(rw_dir, 'hello.txt')
withopen(fp, 'w') asfs:
fs.write("hello world")
r.git.add(fp)
r.git.add(Git.polish_url(fp))
r.git.commit(message="init")

withopen(fp, 'w') asfs:
Expand Down
2 changes: 1 addition & 1 deletion git/test/test_submodule.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -705,7 +705,7 @@ def test_git_submodules_and_add_sm_with_new_commit(self, rwdir):
fp=osp.join(smm.working_tree_dir, 'empty-file')
withopen(fp, 'w'):
pass
smm.git.add(fp)
smm.git.add(Git.polish_url(fp))
smm.git.commit(m="new file added")

# submodules are retrieved from the current commit's tree, therefore we can't really get a new submodule
Expand Down
1 change: 1 addition & 0 deletions git/util.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -264,6 +264,7 @@ def _cygexpath(drive, path):


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