diff options
author | Joey Hess <joey@kitenet.net> | 2014-07-11 14:52:53 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-07-11 14:52:53 -0400 |
commit | 4d925d77c2af45ac655f2246890f5f12ecef728e (patch) | |
tree | 37ae14c9abb7a62f61fbfcec7b9e204f71d13f99 /Test.hs | |
parent | 5886bcd2a804dc7b5c3285bfbfe86fe3516a0b6e (diff) |
uninit: Avoid failing final removal in some direct mode repositories due to file modes.
Specifically .map files.
Diffstat (limited to 'Test.hs')
-rw-r--r-- | Test.hs | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -22,9 +22,7 @@ import qualified Options.Applicative.Types as Opt #endif import Control.Exception.Extensible import qualified Data.Map as M -import System.IO.HVFS (SystemFS(..)) import qualified Text.JSON -import System.Path import Common @@ -78,6 +76,7 @@ import qualified Utility.Hash import qualified Utility.Scheduled import qualified Utility.HumanTime import qualified Utility.ThreadScheduler +import qualified Command.Uninit #ifndef mingw32_HOST_OS import qualified CmdLine.GitAnnex as GitAnnex import qualified Remote.Helper.Encryptable @@ -1492,11 +1491,7 @@ cleanup = cleanup' False cleanup' :: Bool -> FilePath -> IO () cleanup' final dir = whenM (doesDirectoryExist dir) $ do - -- Allow all files and directories to be written to, so - -- they can be deleted. Both git and git-annex use file - -- permissions to prevent deletion. - recurseDir SystemFS dir >>= - mapM_ (void . tryIO . Utility.FileMode.allowWrite) + Command.Uninit.prepareRemoveAnnexDir dir -- This sometimes fails on Windows, due to some files -- being still opened by a subprocess. catchIO (removeDirectoryRecursive dir) $ \e -> |