diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-04-22 14:26:44 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-04-22 14:26:44 -0400 |
commit | c4b2bd9869c4cc1ae036e5be9d1032fb1ee99804 (patch) | |
tree | 86a1e3cc74561e7dd9c16855e53685a8f001b284 /Annex/AdjustedBranch.hs | |
parent | b48a044d26bb607da9962b9086e9da2db9e11620 (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/AdjustedBranch.hs')
-rw-r--r-- | Annex/AdjustedBranch.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Annex/AdjustedBranch.hs b/Annex/AdjustedBranch.hs index 26a24d8e6..2b014a12a 100644 --- a/Annex/AdjustedBranch.hs +++ b/Annex/AdjustedBranch.hs @@ -260,8 +260,8 @@ adjustedBranchCommitMessage = "git-annex adjusted branch" {- Update the currently checked out adjusted branch, merging the provided - branch into it. Note that the provided branch should be a non-adjusted - branch. -} -updateAdjustedBranch :: Branch -> (OrigBranch, Adjustment) -> Git.Branch.CommitMode -> Annex Bool -updateAdjustedBranch tomerge (origbranch, adj) commitmode = catchBoolIO $ +updateAdjustedBranch :: Branch -> (OrigBranch, Adjustment) -> [Git.Merge.MergeConfig] -> Git.Branch.CommitMode -> Annex Bool +updateAdjustedBranch tomerge (origbranch, adj) mergeconfig commitmode = catchBoolIO $ join $ preventCommits go where adjbranch@(AdjBranch currbranch) = originalToAdjusted origbranch adj @@ -304,7 +304,7 @@ updateAdjustedBranch tomerge (origbranch, adj) commitmode = catchBoolIO $ showAction $ "Merging into " ++ fromRef (Git.Ref.base origbranch) -- The --no-ff is important; it makes git -- merge not care that the work tree is empty. - merged <- inRepo (Git.Merge.mergeNonInteractive' [Param "--no-ff"] tomerge commitmode) + merged <- inRepo (Git.Merge.merge' [Param "--no-ff"] tomerge mergeconfig commitmode) <||> (resolveMerge (Just updatedorig) tomerge True <&&> commitResolvedMerge commitmode) if merged then do @@ -340,7 +340,7 @@ updateAdjustedBranch tomerge (origbranch, adj) commitmode = catchBoolIO $ -- this commit will be a fast-forward. adjmergecommitff <- commitAdjustedTree' adjtree (BasisBranch mergecommit) [currbranch] showAction "Merging into adjusted branch" - ifM (autoMergeFrom adjmergecommitff (Just currbranch) commitmode) + ifM (autoMergeFrom adjmergecommitff (Just currbranch) mergeconfig commitmode) ( reparent adjtree adjmergecommit =<< getcurrentcommit , return False ) |