diff options
author | Joey Hess <joey@kitenet.net> | 2013-01-26 20:09:15 +1100 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-01-26 20:09:15 +1100 |
commit | 8126c41bc247cfb31a3d2a9c57cb3e4783e8e37b (patch) | |
tree | 42ba9965d90455a7c9bf331803300e4bc5aab7c4 /Annex/Content.hs | |
parent | 2b604c3556ad538ff573ec073fa1a298daf03151 (diff) |
ensure that content directory is thawed when writing direct mode mapping and cache files
Diffstat (limited to 'Annex/Content.hs')
-rw-r--r-- | Annex/Content.hs | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs index f58628097..ed234511e 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -27,8 +27,6 @@ module Annex.Content ( preseedTmp, freezeContent, thawContent, - freezeContentDir, - createContentDir, replaceFile, ) where @@ -457,27 +455,3 @@ thawContent file = liftIO . go =<< fromRepo getSharedRepository go GroupShared = groupWriteRead file go AllShared = groupWriteRead file go _ = allowWrite file - -{- Blocks writing to the directory an annexed file is in, to prevent the - - file accidentially being deleted. However, if core.sharedRepository - - is set, this is not done, since the group must be allowed to delete the - - file. - -} -freezeContentDir :: FilePath -> Annex () -freezeContentDir file = liftIO . go =<< fromRepo getSharedRepository - where - dir = parentDir file - go GroupShared = groupWriteRead dir - go AllShared = groupWriteRead dir - go _ = preventWrite dir - -{- Makes the directory tree to store an annexed file's content, - - with appropriate permissions on each level. -} -createContentDir :: FilePath -> Annex () -createContentDir dest = do - unlessM (liftIO $ doesDirectoryExist dir) $ - createAnnexDirectory dir - -- might have already existed with restricted perms - liftIO $ allowWrite dir - where - dir = parentDir dest |