From 186732d10740fec3b29751a6076c60148e3479f7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 15 Feb 2013 16:37:57 -0400 Subject: Revert "Clean up direct mode cache and mapping info when dropping keys." This reverts commit f797939d15a2b414e62b28ccb0bd9e5b77978d76. This was buggy, it caused the direct mode cache to be lost when dropping keys, so when the file is gotten back, it's stored in indirect mode. Note to self: Do not attempt bug fixes at 6 am! --- Annex/Content.hs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'Annex/Content.hs') diff --git a/Annex/Content.hs b/Annex/Content.hs index 5abcb2a9e..6ec3368c6 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -28,7 +28,6 @@ module Annex.Content ( freezeContent, thawContent, replaceFile, - cleanObjectLoc, ) where import System.IO.Unsafe (unsafeInterleaveIO) @@ -330,12 +329,9 @@ withObjectLoc key indirect direct = ifM isDirect cleanObjectLoc :: Key -> Annex () cleanObjectLoc key = do file <- inRepo $ gitAnnexLocation key - let dir = parentDir file unlessM crippledFileSystem $ - void $ liftIO $ catchMaybeIO $ allowWrite dir - void $ liftIO $ catchMaybeIO $ do - removeDirectoryRecursive dir - liftIO $ removeparents dir (2 :: Int) + void $ liftIO $ catchMaybeIO $ allowWrite $ parentDir file + liftIO $ removeparents file (3 :: Int) where removeparents _ 0 = noop removeparents file n = do @@ -357,8 +353,8 @@ removeAnnex key = withObjectLoc key remove removedirect cleanObjectLoc key removedirect fs = do cache <- recordedInodeCache key + removeInodeCache key mapM_ (resetfile cache) fs - cleanObjectLoc key resetfile cache f = whenM (liftIO $ compareInodeCache f cache) $ do l <- calcGitLink f key top <- fromRepo Git.repoPath -- cgit v1.2.3