diff options
author | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-09-27 22:07:19 +0200 |
---|---|---|
committer | Kostis Anagnostopoulos <ankostis@gmail.com> | 2016-09-28 03:35:38 +0200 |
commit | 137ee6ef22c4e6480f95972ef220d1832cdc709a (patch) | |
tree | 20d611a4746b5fc4d188673ec309d24e29be5683 /git/test/test_index.py | |
parent | 434505f1b6f882978de17009854d054992b827cf (diff) | |
download | gitpython-137ee6ef22c4e6480f95972ef220d1832cdc709a.tar.gz |
Win, #519: FIX with_rw_directory() to remove read-only dirs
+ Stop using gitdb's respective helper.
+ Fix files chmod(555) which CANNOT DELETE on Windows (but do on Linux).
Diffstat (limited to 'git/test/test_index.py')
-rw-r--r-- | git/test/test_index.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/git/test/test_index.py b/git/test/test_index.py index 2a8df798..0e2bc98c 100644 --- a/git/test/test_index.py +++ b/git/test/test_index.py @@ -11,7 +11,7 @@ from git.test.lib import ( fixture, with_rw_repo ) -from git.util import Actor +from git.util import Actor, rmtree from git.exc import ( HookExecutionError, InvalidGitRepositoryError @@ -32,7 +32,6 @@ from gitdb.util import hex_to_bin import os import sys import tempfile -import shutil from stat import ( S_ISLNK, ST_MODE @@ -46,7 +45,7 @@ from git.index.typ import ( IndexEntry ) from git.index.fun import hook_path -from gitdb.test.lib import with_rw_directory +from git.test.lib import with_rw_directory class TestIndex(TestBase): @@ -387,7 +386,7 @@ class TestIndex(TestBase): assert not open(test_file, 'rb').read().endswith(append_data) # checkout directory - shutil.rmtree(os.path.join(rw_repo.working_tree_dir, "lib")) + rmtree(os.path.join(rw_repo.working_tree_dir, "lib")) rval = index.checkout('lib') assert len(list(rval)) > 1 @@ -719,7 +718,7 @@ class TestIndex(TestBase): with open(hp, "wt") as fp: fp.write("#!/usr/bin/env sh\necho stdout; echo stderr 1>&2; exit 1") # end - os.chmod(hp, 0o544) + os.chmod(hp, 0o744) try: index.commit("This should fail") except HookExecutionError as err: |