summaryrefslogtreecommitdiff
path: root/Assistant/Commits.hs
blob: 79555fee56341e5ec8a67a52b6c8215f8fff5310 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{- git-annex assistant commit tracking
 -
 - Copyright 2012 Joey Hess <joey@kitenet.net>
 -
 - Licensed under the GNU GPL version 3 or higher.
 -}

module Assistant.Commits where

import Assistant.Common
import Assistant.Types.Commits

import Utility.TSet

{- Gets all unhandled commits.
 - Blocks until at least one commit is made. -}
getCommits :: Assistant [Commit]
getCommits = getTSet <<~ commitChan

{- Puts unhandled commits back into the channel.
 - Note: Original order is not preserved. -}
refillCommits :: [Commit] -> Assistant ()
refillCommits cs = flip putTSet cs <<~ commitChan

{- Records a commit in the channel. -}
recordCommit :: Assistant ()
recordCommit = flip putTSet1 Commit <<~ commitChan