summaryrefslogtreecommitdiff
path: root/Annex/Init.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-02-16 15:30:59 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-02-16 15:30:59 -0400
commit21e3147dbd0f96f07e33b3789a0a0e1e64470d2e (patch)
tree1c8edea83fc4af353d7c937e0a1e021d8e2c755d /Annex/Init.hs
parentc11633a52dbdcc187f5afcef50776fa41c7327ce (diff)
fix numerous problem with test suite on crippled filesystems etc
Diffstat (limited to 'Annex/Init.hs')
-rw-r--r--Annex/Init.hs17
1 files changed, 11 insertions, 6 deletions
diff --git a/Annex/Init.hs b/Annex/Init.hs
index 2391549fb..14b39629e 100644
--- a/Annex/Init.hs
+++ b/Annex/Init.hs
@@ -14,6 +14,7 @@ module Annex.Init (
initialize',
uninitialize,
probeCrippledFileSystem,
+ probeCrippledFileSystem',
) where
import Annex.Common
@@ -134,16 +135,20 @@ isBare = fromRepo Git.repoIsLocalBare
- or removing write access from files. -}
probeCrippledFileSystem :: Annex Bool
probeCrippledFileSystem = do
+ tmp <- fromRepo gitAnnexTmpMiscDir
+ createAnnexDirectory tmp
+ liftIO $ probeCrippledFileSystem' tmp
+
+probeCrippledFileSystem' :: FilePath -> IO Bool
+probeCrippledFileSystem' tmp = do
#ifdef mingw32_HOST_OS
return True
#else
- tmp <- fromRepo gitAnnexTmpMiscDir
let f = tmp </> "gaprobe"
- createAnnexDirectory tmp
- liftIO $ writeFile f ""
- uncrippled <- liftIO $ probe f
- void $ liftIO $ tryIO $ allowWrite f
- liftIO $ removeFile f
+ writeFile f ""
+ uncrippled <- probe f
+ void $ tryIO $ allowWrite f
+ removeFile f
return $ not uncrippled
where
probe f = catchBoolIO $ do