skip test_readonly on windows

drop vs readonly repo failed (transcript follows)
      drop foo
      failed
      git-annex: .git\annex\objects\6cd\e82\SHA256E-s20--e394a389d787383843decc5d3d99b6d184ffa5fddeec23b911f9ee7fc8b9ea77\SHA256E-s20--e394a389d787383843decc5d3d99b6d184ffa5fddeec23b911f9ee7fc8b9ea77: DeleteFile "\\\\?\\C:\\Users\\runneradmin\\.t\\tmprepo3\\.git\\annex\\objects\\6cd\\e82\\SHA256E-s20--e394a389d787383843decc5d3d99b6d184ffa5fddeec23b911f9ee7fc8b9ea77\\SHA256E-s20--e394a389d787383843decc5d3d99b6d184ffa5fddeec23b911f9ee7fc8b9ea77": permission denied (Access is denied.)

This is a bit surprising, it seems that chmod -R -w on windows actually
had some effect. But also, on Windows lockContentShared
has to write to a lock file, so it cannot work in a readonly repo.
So git-annex cannot support readonly repos on Windows.

Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
Joey Hess 2021-09-01 10:42:50 -04:00
parent 6329997ac4
commit afdca0aff4
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -431,6 +431,7 @@ test_add_extras = intmpclonerepo $ do
test_readonly :: Assertion
test_readonly =
#ifndef mingw32_HOST_OS
withtmpclonerepo $ \r1 ->
withtmpclonerepo $ \r2 -> do
pair r1 r2
@ -445,6 +446,11 @@ test_readonly =
git_annex "get" [annexedfile, "--from", "r1"] "get from readonly repo"
git "remote" ["rm", "origin"] "remote rm"
git_annex "drop" [annexedfile] "drop vs readonly repo"
#else
-- This test does not work on Windows, and it doesn't make sense to
-- try to support this on Windows anyway.
return ()
#endif
test_ignore_deleted_files :: Assertion
test_ignore_deleted_files = intmpclonerepo $ do