diff options
author | Joey Hess <joey@kitenet.net> | 2013-03-10 21:36:13 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-03-10 22:10:26 -0400 |
commit | 9d5b42222a10050fc733a49c427359f88e8be36c (patch) | |
tree | 4fa0b1d6cf4a38ba772557dc4277fbd887020e46 /Assistant/Commits.hs | |
parent | e107ddb4507d92303e14ebee3ccdec7662350031 (diff) |
assistant: generate better commits for renames
Diffstat (limited to 'Assistant/Commits.hs')
-rw-r--r-- | Assistant/Commits.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Assistant/Commits.hs b/Assistant/Commits.hs index 79555fee5..f4e908e0d 100644 --- a/Assistant/Commits.hs +++ b/Assistant/Commits.hs @@ -9,19 +9,20 @@ module Assistant.Commits where import Assistant.Common import Assistant.Types.Commits - import Utility.TSet +import Control.Concurrent.STM + {- Gets all unhandled commits. - Blocks until at least one commit is made. -} getCommits :: Assistant [Commit] -getCommits = getTSet <<~ commitChan +getCommits = (atomically . getTSet) <<~ commitChan {- Puts unhandled commits back into the channel. - Note: Original order is not preserved. -} refillCommits :: [Commit] -> Assistant () -refillCommits cs = flip putTSet cs <<~ commitChan +refillCommits cs = (atomically . flip putTSet cs) <<~ commitChan {- Records a commit in the channel. -} recordCommit :: Assistant () -recordCommit = flip putTSet1 Commit <<~ commitChan +recordCommit = (atomically . flip putTSet1 Commit) <<~ commitChan |