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

@ -248,8 +248,13 @@ resolveMerge' :: LsFiles.Unmerged -> Annex Bool
resolveMerge' u
| issymlink LsFiles.valUs && issymlink LsFiles.valThem =
withKey LsFiles.valUs $ \keyUs ->
withKey LsFiles.valThem $ \keyThem -> do
go keyUs keyThem
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
| otherwise = return False
where
go keyUs keyThem
@ -257,11 +262,6 @@ resolveMerge' u
makelink keyUs
return True
| 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 keyThem
return True