From 52ec7a96752c5aa03749ff945a00371f7a7d22c2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 26 May 2013 18:32:11 -0400 Subject: 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. --- Command/Sync.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Command') diff --git a/Command/Sync.hs b/Command/Sync.hs index 96aae888b..091431bda 100644 --- a/Command/Sync.hs +++ b/Command/Sync.hs @@ -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 -- cgit v1.2.3