aboutsummaryrefslogtreecommitdiff
path: root/Assistant
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-02-29 15:57:47 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-02-29 15:57:47 -0400
commit6d4ab4dc7389e2184d32962b751268125dfa56ae (patch)
tree9d3f29e122aa92e82d499580b4ffb84be8619eba /Assistant
parent453ba048af869ed731e54f39b8b9db7d6859510a (diff)
make assistant aware of adjusted branches when merging
Diffstat (limited to 'Assistant')
-rw-r--r--Assistant/Threads/Merger.hs16
-rw-r--r--Assistant/XMPP/Git.hs1
2 files changed, 9 insertions, 8 deletions
diff --git a/Assistant/Threads/Merger.hs b/Assistant/Threads/Merger.hs
index f1a64925d..35d02322d 100644
--- a/Assistant/Threads/Merger.hs
+++ b/Assistant/Threads/Merger.hs
@@ -17,7 +17,7 @@ import Utility.DirWatcher.Types
import qualified Annex.Branch
import qualified Git
import qualified Git.Branch
-import Annex.AutoMerge
+import qualified Command.Sync
import Annex.TaggedPush
import Remote (remoteFromUUID)
@@ -72,19 +72,21 @@ onChange file
unlessM handleDesynced $
queueDeferredDownloads "retrying deferred download" Later
| "/synced/" `isInfixOf` file =
- mergecurrent =<< liftAnnex (inRepo Git.Branch.current)
+ mergecurrent =<< liftAnnex (join Command.Sync.getCurrBranch)
| otherwise = noop
where
changedbranch = fileToBranch file
- mergecurrent (Just current)
- | equivBranches changedbranch current =
- whenM (liftAnnex $ inRepo $ Git.Branch.changed current changedbranch) $ do
+ mergecurrent currbranch@(Just b, _)
+ | equivBranches changedbranch b =
+ whenM (liftAnnex $ inRepo $ Git.Branch.changed b changedbranch) $ do
debug
[ "merging", Git.fromRef changedbranch
- , "into", Git.fromRef current
+ , "into", Git.fromRef b
]
- void $ liftAnnex $ autoMergeFrom changedbranch (Just current) Git.Branch.AutomaticCommit
+ void $ liftAnnex $ Command.Sync.merge
+ currbranch Git.Branch.AutomaticCommit
+ changedbranch
mergecurrent _ = noop
handleDesynced = case fromTaggedBranch changedbranch of
diff --git a/Assistant/XMPP/Git.hs b/Assistant/XMPP/Git.hs
index 9e0b9278b..286fcf879 100644
--- a/Assistant/XMPP/Git.hs
+++ b/Assistant/XMPP/Git.hs
@@ -27,7 +27,6 @@ import Annex.TaggedPush
import Annex.CatFile
import Config
import Git
-import qualified Git.Branch
import qualified Types.Remote as Remote
import qualified Remote as Remote
import Remote.List