diff options
Diffstat (limited to 'Annex/Init.hs')
-rw-r--r-- | Annex/Init.hs | 17 |
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 |