aboutsummaryrefslogtreecommitdiff
path: root/Assistant
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 /Assistant
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 'Assistant')
-rw-r--r--Assistant/Sync.hs10
-rw-r--r--Assistant/Threads/Merger.hs3
2 files changed, 2 insertions, 11 deletions
diff --git a/Assistant/Sync.hs b/Assistant/Sync.hs
index 9b9e7ebe5..ff34c0656 100644
--- a/Assistant/Sync.hs
+++ b/Assistant/Sync.hs
@@ -21,7 +21,6 @@ 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
@@ -239,19 +238,12 @@ manualPull currentbranch remotes = do
)
haddiverged <- liftAnnex Annex.Branch.forceUpdate
forM_ normalremotes $ \r ->
- liftAnnex $ Command.Sync.mergeRemote r currentbranch mergeConfig
+ liftAnnex $ Command.Sync.mergeRemote r currentbranch Command.Sync.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
diff --git a/Assistant/Threads/Merger.hs b/Assistant/Threads/Merger.hs
index 521e5bda6..ce0dfbcb4 100644
--- a/Assistant/Threads/Merger.hs
+++ b/Assistant/Threads/Merger.hs
@@ -12,7 +12,6 @@ import Assistant.TransferQueue
import Assistant.BranchChange
import Assistant.DaemonStatus
import Assistant.ScanRemotes
-import Assistant.Sync
import Utility.DirWatcher
import Utility.DirWatcher.Types
import qualified Annex.Branch
@@ -86,7 +85,7 @@ onChange file
, "into", Git.fromRef b
]
void $ liftAnnex $ Command.Sync.merge
- currbranch mergeConfig
+ currbranch Command.Sync.mergeConfig
Git.Branch.AutomaticCommit
changedbranch
mergecurrent _ = noop