summaryrefslogtreecommitdiff
path: root/CmdLine/GitAnnex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-11-05 19:57:41 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-11-05 19:57:41 -0400
commit393d156deb01a71031c3a7ff6fe87d5e945b619e (patch)
tree56615427e6d6ccf7d1ec407dfc86c786e5d5a55a /CmdLine/GitAnnex
parentee862923fe00d6c73bf0a0a429dc6f24c1c545fc (diff)
increase number of capabilities to match -Jn setting
Diffstat (limited to 'CmdLine/GitAnnex')
-rw-r--r--CmdLine/GitAnnex/Options.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/CmdLine/GitAnnex/Options.hs b/CmdLine/GitAnnex/Options.hs
index b004e4239..7d8bcadee 100644
--- a/CmdLine/GitAnnex/Options.hs
+++ b/CmdLine/GitAnnex/Options.hs
@@ -9,6 +9,7 @@ module CmdLine.GitAnnex.Options where
import Options.Applicative
import Options.Applicative.Builder.Internal
+import Control.Concurrent
import Common.Annex
import qualified Git.Config
@@ -292,7 +293,11 @@ jobsOption = globalSetter set $
<> hidden
)
where
- set n = Annex.changeState $ \s -> s { Annex.concurrentjobs = Just n }
+ set n = do
+ Annex.changeState $ \s -> s { Annex.concurrentjobs = Just n }
+ c <- liftIO getNumCapabilities
+ when (n > c) $
+ liftIO $ setNumCapabilities n
timeLimitOption :: GlobalOption
timeLimitOption = globalSetter Limit.addTimeLimit $ strOption