fix merge conflict resolution when both sides have the same key

Still need to git rm the old file so git accepts the merge is resolved.
This commit is contained in:
Joey Hess 2013-05-26 18:32:11 -04:00
parent 749beb5899
commit f1cce62283

View file

@ -249,6 +249,11 @@ resolveMerge' u
| issymlink LsFiles.valUs && issymlink LsFiles.valThem = | issymlink LsFiles.valUs && issymlink LsFiles.valThem =
withKey LsFiles.valUs $ \keyUs -> withKey LsFiles.valUs $ \keyUs ->
withKey LsFiles.valThem $ \keyThem -> do withKey LsFiles.valThem $ \keyThem -> do
ifM isDirect
( maybe noop (\k -> removeDirect k file) keyUs
, liftIO $ nukeFile file
)
Annex.Queue.addCommand "rm" [Params "--quiet -f --"] [file]
go keyUs keyThem go keyUs keyThem
| otherwise = return False | otherwise = return False
where where
@ -257,11 +262,6 @@ resolveMerge' u
makelink keyUs makelink keyUs
return True return True
| otherwise = do | otherwise = do
ifM isDirect
( maybe noop (\k -> removeDirect k file) keyUs
, liftIO $ nukeFile file
)
Annex.Queue.addCommand "rm" [Params "--quiet -f --"] [file]
makelink keyUs makelink keyUs
makelink keyThem makelink keyThem
return True return True