summaryrefslogtreecommitdiff
path: root/Annex.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex.hs')
-rw-r--r--Annex.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Annex.hs b/Annex.hs
index f8cfd0ec9..608151d82 100644
--- a/Annex.hs
+++ b/Annex.hs
@@ -16,6 +16,7 @@ module Annex (
gitRepo,
queue,
queueRun,
+ queueRunAt,
setConfig,
repoConfig
) where
@@ -109,6 +110,13 @@ queueRun = do
liftIO $ GitQueue.run g q
put state { repoqueue = GitQueue.empty }
+{- Runs the queue if the specified number of items have been queued. -}
+queueRunAt :: Integer -> Annex ()
+queueRunAt n = do
+ state <- get
+ let q = repoqueue state
+ when (GitQueue.size q >= n) queueRun
+
{- Changes a git config setting in both internal state and .git/config -}
setConfig :: String -> String -> Annex ()
setConfig k value = do