From a2d248bb8362808121f6b6abfd316d83b65afa79 Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Fri, 14 Oct 2016 18:21:17 +0200 Subject: 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 --- git/test/test_diff.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'git/test/test_diff.py') diff --git a/git/test/test_diff.py b/git/test/test_diff.py index d34d84e3..d5f5b721 100644 --- a/git/test/test_diff.py +++ b/git/test/test_diff.py @@ -25,6 +25,7 @@ from git import ( NULL_TREE, ) import ddt +from git.cmd import Git @ddt.ddt @@ -56,7 +57,7 @@ class TestDiff(TestBase): fp = os.path.join(rw_dir, 'hello.txt') with open(fp, 'w') as fs: fs.write("hello world") - r.git.add(fp) + r.git.add(Git.polish_url(fp)) r.git.commit(message="init") with open(fp, 'w') as fs: -- cgit v1.2.1 From 0210e394e0776d0b7097bf666bebd690ed0c0e4f Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Sat, 15 Oct 2016 13:11:16 +0200 Subject: src: import os.path as osp --- git/test/test_diff.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'git/test/test_diff.py') diff --git a/git/test/test_diff.py b/git/test/test_diff.py index d5f5b721..48a5a641 100644 --- a/git/test/test_diff.py +++ b/git/test/test_diff.py @@ -4,8 +4,15 @@ # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php -import os - +import ddt +from git import ( + Repo, + GitCommandError, + Diff, + DiffIndex, + NULL_TREE, +) +from git.cmd import Git from git.test.lib import ( TestBase, StringProcessAdapter, @@ -14,18 +21,9 @@ from git.test.lib import ( assert_true, ) - from git.test.lib import with_rw_directory -from git import ( - Repo, - GitCommandError, - Diff, - DiffIndex, - NULL_TREE, -) -import ddt -from git.cmd import Git +import os.path as osp @ddt.ddt @@ -54,7 +52,7 @@ class TestDiff(TestBase): def test_diff_with_staged_file(self, rw_dir): # SETUP INDEX WITH MULTIPLE STAGES r = Repo.init(rw_dir) - fp = os.path.join(rw_dir, 'hello.txt') + fp = osp.join(rw_dir, 'hello.txt') with open(fp, 'w') as fs: fs.write("hello world") r.git.add(Git.polish_url(fp)) -- cgit v1.2.1