make direct mode merge cleanup more robust

If the cleanup of a single file fails for some reason, continue
to clean up other files.

This could happen because of a race. The merge pulls in a change to a file,
which gets changed locally at the same time.
This commit is contained in:
Joey Hess 2013-05-25 15:11:54 -04:00
parent bf86b5ca16
commit 5eeea0fac9

View file

@ -27,6 +27,7 @@ import Utility.InodeCache
import Utility.CopyFile
import Annex.Perms
import Annex.ReplaceFile
import Annex.Exception
{- 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. -}
@ -139,8 +140,10 @@ mergeDirectCleanup d oldsha newsha = do
liftIO $ removeDirectoryRecursive d
where
updated item = do
go DiffTree.srcsha DiffTree.srcmode moveout moveout_raw
go DiffTree.dstsha DiffTree.dstmode movein movein_raw
void $ tryAnnex $
go DiffTree.srcsha DiffTree.srcmode moveout moveout_raw
void $ tryAnnex $
go DiffTree.dstsha DiffTree.dstmode movein movein_raw
where
go getsha getmode a araw
| getsha item == nullSha = noop