From 5eeea0fac9db5562208e391231883d3b93abd4bf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 25 May 2013 15:11:54 -0400 Subject: [PATCH] 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. --- Annex/Direct.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Annex/Direct.hs b/Annex/Direct.hs index a3bc951d1a..c958ac2871 100644 --- a/Annex/Direct.hs +++ b/Annex/Direct.hs @@ -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