summaryrefslogtreecommitdiff
path: root/git/test/test_base.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-06 16:58:40 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-06 16:58:40 +0100
commit5d0ad081ca0e723ba2a12c876b4cd1574485c726 (patch)
tree0a608c07c48b74600453644c7e41caa808faec73 /git/test/test_base.py
parentc824bcd73de8a7035f7e55ab3375ee0b6ab28c46 (diff)
downloadgitpython-5d0ad081ca0e723ba2a12c876b4cd1574485c726.tar.gz
Improved windows test suite.
Also added code to show how to deal with #147
Diffstat (limited to 'git/test/test_base.py')
-rw-r--r--git/test/test_base.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/git/test/test_base.py b/git/test/test_base.py
index 301384ef..f581138b 100644
--- a/git/test/test_base.py
+++ b/git/test/test_base.py
@@ -118,5 +118,16 @@ class TestBase(TestBase):
file_path = os.path.join(rw_repo.working_dir, filename)
open(file_path, "wb").write(b'something')
- rw_repo.git.add(rw_repo.working_dir)
+
+ if os.name == 'nt':
+ # on windows, there is no way this works, see images on
+ # https://github.com/gitpython-developers/GitPython/issues/147#issuecomment-68881897
+ # Therefore, it must be added using the python implementation
+ rw_repo.index.add([file_path])
+ # However, when the test winds down, rmtree fails to delete this file, which is recognized
+ # as ??? only.
+ else:
+ # on posix, we can just add unicode files without problems
+ rw_repo.git.add(rw_repo.working_dir)
+ # end
rw_repo.index.commit('message')