aboutsummaryrefslogtreecommitdiff
path: root/Assistant/Sync.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 /Assistant/Sync.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 'Assistant/Sync.hs')
-rw-r--r--Assistant/Sync.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/Assistant/Sync.hs b/Assistant/Sync.hs
index ebdead00d..665394a4d 100644
--- a/Assistant/Sync.hs
+++ b/Assistant/Sync.hs
@@ -21,6 +21,7 @@ import Utility.Parallel
import qualified Git
import qualified Git.Command
import qualified Git.Ref
+import qualified Git.Merge
import qualified Remote
import qualified Types.Remote as Remote
import qualified Remote.List as Remote
@@ -238,12 +239,19 @@ manualPull currentbranch remotes = do
)
haddiverged <- liftAnnex Annex.Branch.forceUpdate
forM_ normalremotes $ \r ->
- liftAnnex $ Command.Sync.mergeRemote r currentbranch
+ liftAnnex $ Command.Sync.mergeRemote r currentbranch mergeConfig
u <- liftAnnex getUUID
forM_ xmppremotes $ \r ->
sendNetMessage $ Pushing (getXMPPClientID r) (PushRequest u)
return (catMaybes failed, haddiverged)
+mergeConfig :: [Git.Merge.MergeConfig]
+mergeConfig =
+ [ Git.Merge.MergeNonInteractive
+ -- Pairing involves merging unrelated histories
+ , Git.Merge.MergeUnrelatedHistories
+ ]
+
{- Start syncing a remote, using a background thread. -}
syncRemote :: Remote -> Assistant ()
syncRemote remote = do