summaryrefslogtreecommitdiff
path: root/Assistant/Threads/Merger.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2018-10-19 15:17:48 -0400
committerJoey Hess <joeyh@joeyh.name>2018-10-19 17:29:18 -0400
commit8be5a7269a0813b64116d80b130d86a905a20fcf (patch)
treee13a7eaac88ac40f9729969551376d025ee22588 /Assistant/Threads/Merger.hs
parentc94e62cab50cee37c96fb161735d5d65273580e3 (diff)
refactor getCurrentBranch
Both Command.Sync and Annex.Ingest had their own versions of this. The one in Annex.Ingest used Git.Branch.currentUnsafe, but does not seem to need it. That is only checking to see if it's in an adjusted unlocked branch, and when in an adjusted branch, the branch does in fact exist, so the added check that Git.Branch.current does is fine. This commit was sponsored by Denis Dzyubenko on Patreon.
Diffstat (limited to 'Assistant/Threads/Merger.hs')
-rw-r--r--Assistant/Threads/Merger.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Assistant/Threads/Merger.hs b/Assistant/Threads/Merger.hs
index ff2fdc9a00..24f4705226 100644
--- a/Assistant/Threads/Merger.hs
+++ b/Assistant/Threads/Merger.hs
@@ -13,6 +13,7 @@ import Assistant.BranchChange
import Assistant.Sync
import Utility.DirWatcher
import Utility.DirWatcher.Types
+import Annex.CurrentBranch
import qualified Annex.Branch
import qualified Git
import qualified Git.Branch
@@ -71,7 +72,7 @@ onChange file
changedbranch = fileToBranch file
mergecurrent =
- mergecurrent' =<< liftAnnex (join Command.Sync.getCurrBranch)
+ mergecurrent' =<< liftAnnex getCurrentBranch
mergecurrent' currbranch@(Just b, _)
| changedbranch `isRelatedTo` b =
whenM (liftAnnex $ inRepo $ Git.Branch.changed b changedbranch) $ do