thaw content directory in direct mode too

A content directory can be frozen in direct mode. One way this can happen
is if the content is transferred before direct mode has a mapping for it,
so it's stored in the content directory.

So, we need to thaw the content directory before doing things with it.
This commit is contained in:
Joey Hess 2013-04-30 19:33:43 -04:00
parent 1111552efd
commit 0807211a67
3 changed files with 6 additions and 0 deletions

View file

@ -25,6 +25,7 @@ import Annex.Content.Direct
import Annex.Link
import Utility.InodeCache
import Utility.CopyFile
import Annex.Perms
{- Uses git ls-files to find files that need to be committed, and stages
- them into the index. Returns True if some changes were staged. -}
@ -187,6 +188,7 @@ toDirectGen k f = do
[] -> ifM (liftIO $ doesFileExist loc)
( return $ Just $ do
{- Move content from annex to direct file. -}
thawContentDir loc
updateInodeCache k loc
thawContent loc
replaceFile f $ liftIO . moveFile loc