diff options
author | Joey Hess <joey@kitenet.net> | 2013-05-26 18:32:11 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-05-26 18:32:11 -0400 |
commit | 52ec7a96752c5aa03749ff945a00371f7a7d22c2 (patch) | |
tree | 3d33cf0318166d67d4834583db877227257569d8 | |
parent | 029b25dc0d4ac6b035eedfedb44fdfe7bb35a580 (diff) |
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.
-rw-r--r-- | Command/Sync.hs | 14 |
1 files changed, 7 insertions, 7 deletions
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 |