summaryrefslogtreecommitdiff
path: root/Annex/Content/Direct.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex/Content/Direct.hs')
-rw-r--r--Annex/Content/Direct.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Annex/Content/Direct.hs b/Annex/Content/Direct.hs
index 99b54f7e0..265195b87 100644
--- a/Annex/Content/Direct.hs
+++ b/Annex/Content/Direct.hs
@@ -109,8 +109,10 @@ compareCache file old = do
{- Stores a cache of attributes for a file that is associated with a key. -}
updateCache :: Key -> FilePath -> Annex ()
-updateCache key file = withCacheFile key $ \cachefile ->
- maybe noop (writeFile cachefile . showCache) =<< genCache file
+updateCache key file = do
+ withCacheFile key $ \cachefile -> do
+ createDirectoryIfMissing True (parentDir cachefile)
+ maybe noop (writeFile cachefile . showCache) =<< genCache file
{- Removes a cache. -}
removeCache :: Key -> Annex ()