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.
This commit is contained in:
Joey Hess 2013-05-25 18:37:56 -04:00
parent 33fe3dac9e
commit fc37456d0f

View file

@ -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