From fc37456d0fe1fb0fd3e33338223977b3e7a940bb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 25 May 2013 18:37:56 -0400 Subject: [PATCH] fuzz test discovered a way automatic merge resultion can fail; fix It may be that the directory we need to make a symlink in, to resolve the merge, doesn't exist locally. --- Command/Sync.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Command/Sync.hs b/Command/Sync.hs index 066a12a566..d6f1022cca 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -28,6 +28,7 @@ import qualified Types.Remote import qualified Remote.Git import Types.Key import Config +import Annex.ReplaceFile import Data.Hash.MD5 @@ -270,8 +271,7 @@ resolveMerge' u makelink (Just key) = do let dest = mergeFile file key l <- inRepo $ gitAnnexLink dest key - liftIO $ nukeFile dest - addAnnexLink l dest + replaceFile dest $ addAnnexLink l whenM (isDirect) $ toDirect key dest makelink _ = noop