summaryrefslogtreecommitdiff
path: root/Annex/AutoMerge.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-04-22 14:26:44 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-04-22 14:26:44 -0400
commitc4b2bd9869c4cc1ae036e5be9d1032fb1ee99804 (patch)
tree86a1e3cc74561e7dd9c16855e53685a8f001b284 /Annex/AutoMerge.hs
parentb48a044d26bb607da9962b9086e9da2db9e11620 (diff)
assistant: Deal with upcoming git's refusal to merge unrelated histories by default
git 2.8.1 (or perhaps 2.9.0) is going to prevent git merge from merging in unrelated branches. Since the webapp's pairing etc features often combine together repositories with unrelated histories, work around this behavior change by setting GIT_MERGE_ALLOW_UNRELATED_HISTORIES when the assistant merges. Note though that this is not done for git annex sync's merges, so it will follow git's default or configured behavior.
Diffstat (limited to 'Annex/AutoMerge.hs')
-rw-r--r--Annex/AutoMerge.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Annex/AutoMerge.hs b/Annex/AutoMerge.hs
index e6f2be552..26f58a98e 100644
--- a/Annex/AutoMerge.hs
+++ b/Annex/AutoMerge.hs
@@ -43,16 +43,16 @@ import qualified Data.ByteString.Lazy as L
- Callers should use Git.Branch.changed first, to make sure that
- there are changes from the current branch to the branch being merged in.
-}
-autoMergeFrom :: Git.Ref -> Maybe Git.Ref -> Git.Branch.CommitMode -> Annex Bool
-autoMergeFrom branch currbranch commitmode = do
+autoMergeFrom :: Git.Ref -> Maybe Git.Ref -> [Git.Merge.MergeConfig] -> Git.Branch.CommitMode -> Annex Bool
+autoMergeFrom branch currbranch mergeconfig commitmode = do
showOutput
case currbranch of
Nothing -> go Nothing
Just b -> go =<< inRepo (Git.Ref.sha b)
where
go old = ifM isDirect
- ( mergeDirect currbranch old branch (resolveMerge old branch False) commitmode
- , inRepo (Git.Merge.mergeNonInteractive branch commitmode)
+ ( mergeDirect currbranch old branch (resolveMerge old branch False) mergeconfig commitmode
+ , inRepo (Git.Merge.merge branch mergeconfig commitmode)
<||> (resolveMerge old branch False <&&> commitResolvedMerge commitmode)
)