From 4d925d77c2af45ac655f2246890f5f12ecef728e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 11 Jul 2014 14:52:53 -0400 Subject: uninit: Avoid failing final removal in some direct mode repositories due to file modes. Specifically .map files. --- Test.hs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'Test.hs') diff --git a/Test.hs b/Test.hs index 4e7d6df75..39da14e65 100644 --- a/Test.hs +++ b/Test.hs @@ -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 -> -- cgit v1.2.3