aboutsummaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-05-25 15:11:54 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-05-25 15:22:16 -0400
commitf9a9ee1f739843b0b7c12a620d7adb55939bacbc (patch)
treea2c49c8746dd5d041ef6423de3ea37e063693f7b /Annex
parent65962bdc503a084bf17a488e1a5e03c41fb29b2a (diff)
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.
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Direct.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Annex/Direct.hs b/Annex/Direct.hs
index a3bc951d1..c958ac287 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