test-convert-git: remove the read-only attribute of repository files
authorEduard-Cristian Stefan <alexandrul.ct@gmail.com>
Fri, 08 Jun 2012 05:37:06 +0300
changeset 16893 46ccd44dd65b
parent 16892 cfd892b7569f
child 16894 f9b352b65180
test-convert-git: remove the read-only attribute of repository files Git object files are stored read-only in the filesystem. Trying to remove a read-only file on windows will fail with access denied, so we have to make them writeable before they can be removed.
tests/test-convert-git.t
--- a/tests/test-convert-git.t	Fri Jun 08 05:31:28 2012 +0300
+++ b/tests/test-convert-git.t	Fri Jun 08 05:37:06 2012 +0300
@@ -283,9 +283,12 @@
 
   $ cat > damage.py <<EOF
   > import os
+  > import stat
   > for root, dirs, files in os.walk('git-repo4/.git/objects'):
   >     if files:
   >         path = os.path.join(root, files[0])
+  >         if os.name == 'nt':
+  >             os.chmod(path, stat.S_IWUSR)
   >         os.remove(path)
   >         break
   > EOF