summaryrefslogtreecommitdiff
path: root/Remote/Directory.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-08-04 13:39:31 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-08-04 13:43:48 -0400
commit189350419e0775e4175aa860326c5ce62a974d59 (patch)
treed2f84990d0300f828512cfa18e4122ae037a7737 /Remote/Directory.hs
parent381c1f7634e20a2faa0b15255870f9dbf745f230 (diff)
Windows: Fixed permissions problem that prevented removing files from directory special remote.
Directory special remotes now fully usable.
Diffstat (limited to 'Remote/Directory.hs')
-rw-r--r--Remote/Directory.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Remote/Directory.hs b/Remote/Directory.hs
index adf2c09dc..6cc75d2f1 100644
--- a/Remote/Directory.hs
+++ b/Remote/Directory.hs
@@ -231,6 +231,11 @@ retrieveCheap _ _ _ _ = return False
remove :: FilePath -> Key -> Annex Bool
remove d k = liftIO $ do
void $ tryIO $ allowWrite dir
+#ifdef mingw32_HOST_OS
+ {- Windows needs the files inside the directory to be writable
+ - before it can delete them. -}
+ void $ tryIO $ mapM_ allowWrite =<< dirContents dir
+#endif
catchBoolIO $ do
removeDirectoryRecursive dir
return True