aboutsummaryrefslogtreecommitdiff
path: root/Command/Sync.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-11-15 18:26:17 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-11-15 18:26:17 -0400
commit89e19686ec88d68355ce756ead1245e9bf1bd44e (patch)
treece68ea6a7e779dd477294ecdcc813ac0663fc9ba /Command/Sync.hs
parentd943787ca787d32071643d5b94efa312fafe6ba8 (diff)
sync: Pass --allow-unrelated-histories to git merge when used with git git 2.9.0 or newer.
This makes merging a remote into a freshly created direct mode repository work the same as it works in indirect mode. The git-annex branches would get merged in any case by a sync, since that doesn't use git merge. This might need to be revisited later to better mirror git's behavior.
Diffstat (limited to 'Command/Sync.hs')
-rw-r--r--Command/Sync.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Command/Sync.hs b/Command/Sync.hs
index d7edac743..fb80c3e74 100644
--- a/Command/Sync.hs
+++ b/Command/Sync.hs
@@ -169,7 +169,12 @@ prepMerge :: Annex ()
prepMerge = Annex.changeDirectory =<< fromRepo Git.repoPath
mergeConfig :: [Git.Merge.MergeConfig]
-mergeConfig = [Git.Merge.MergeNonInteractive]
+mergeConfig =
+ [ Git.Merge.MergeNonInteractive
+ -- In several situations, unrelated histories should be merged
+ -- together. This includes pairing in the assistant etc.
+ , Git.Merge.MergeUnrelatedHistories
+ ]
merge :: CurrBranch -> [Git.Merge.MergeConfig] -> Git.Branch.CommitMode -> Git.Branch -> Annex Bool
merge (Just b, Just adj) mergeconfig commitmode tomerge =