summaryrefslogtreecommitdiff
path: root/Command/Sync.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-06-27 12:09:01 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-06-27 12:11:03 -0400
commit051c68041b5b7a58e7080403e389d0641691edfd (patch)
tree8539a1a7e48d8767397a5df97a076e431f215bb5 /Command/Sync.hs
parent8e8439a5191e8768edebdcf27668157b70c0ebf7 (diff)
properly handle deleted files when processing ls-files --unmerged
Diffstat (limited to 'Command/Sync.hs')
-rw-r--r--Command/Sync.hs24
1 files changed, 22 insertions, 2 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index 1da6b0b81..2f3863617 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -155,10 +155,30 @@ mergeAnnex = do
Annex.Branch.forceUpdate
stop
-mergeFrom :: Git.Ref -> CommandCleanup
+mergeFrom :: Git.Ref -> Annex Bool
mergeFrom branch = do
showOutput
- inRepo $ Git.Merge.mergeNonInteractive branch
+ ok <- inRepo $ Git.Merge.mergeNonInteractive branch
+ if ok
+ then return ok
+ else resolveMerge
+
+{- Resolves a conflicted merge. It's important that any conflicts be
+ - resolved in a way that itself avoids later merge conflicts, since
+ - multiple repositories may be doing this concurrently.
+ -
+ - Only annexed files are resolved; other files are left for the user to
+ - handle.
+ -
+ - This uses the Keys pointed to by the files to construct new
+ - filenames. So a conflicted merge of file foo will delete it,
+ - and add files foo.KEYA and foo.KEYB.
+ -
+ - A conflict can also result due to
+ -}
+resolveMerge :: Annex Bool
+resolveMerge = do
+
changed :: Remote -> Git.Ref -> Annex Bool
changed remote b = do