From 5f835c769eb673b28d2d0211adfd6cbdf420b4bc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 19 Oct 2012 14:25:15 -0400 Subject: remove git-annex branch read cache This cache prevented noticing changes made by another process. The case I just ran into involved the assistant dropping a file, which cached its presence info. Then the same file was downloaded again, but the assistant didn't know its presence info had changed. I don't see a way to keep this cache. Will instead rely on the OS level file cache, for files in the journal. May need to add more higher-level caching of info that it's ok to have a potentially stale copy of, although much of git-annex already does so. --- Annex/BranchState.hs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'Annex/BranchState.hs') diff --git a/Annex/BranchState.hs b/Annex/BranchState.hs index 2e60d1229..9b2f9a04c 100644 --- a/Annex/BranchState.hs +++ b/Annex/BranchState.hs @@ -1,6 +1,6 @@ {- git-annex branch state management - - - Runtime state about the git-annex branch, including a small read cache. + - Runtime state about the git-annex branch. - - Copyright 2011-2012 Joey Hess - @@ -22,22 +22,6 @@ setState state = Annex.changeState $ \s -> s { Annex.branchstate = state } changeState :: (BranchState -> BranchState) -> Annex () changeState changer = setState =<< changer <$> getState -setCache :: FilePath -> String -> Annex () -setCache file content = changeState $ \s -> s - { cachedFile = Just file, cachedContent = content} - -getCache :: FilePath -> Annex (Maybe String) -getCache file = from <$> getState - where - from state - | cachedFile state == Just file = - Just $ cachedContent state - | otherwise = Nothing - -invalidateCache :: Annex () -invalidateCache = changeState $ \s -> s - { cachedFile = Nothing, cachedContent = "" } - {- Runs an action to check that the index file exists, if it's not been - checked before in this run of git-annex. -} checkIndexOnce :: Annex () -> Annex () -- cgit v1.2.3