aboutsummaryrefslogtreecommitdiff
path: root/Command/Watch.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-12-29 14:45:19 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-12-29 14:45:19 -0400
commit992eb6d6931cfc2ca8da0fe2d25e58742ce8cd77 (patch)
treecb1b35a324ee240fc2291b847e96e46944e5fbfc /Command/Watch.hs
parenta2acf0ed7f27bf4ce37be39d1c5f47c414183ead (diff)
convert notBareRepo to a CommandCheck
This avoids some small overhead by only running the check once per command; it also ensures that, even if the command doesn't find anything to run on, it still fails to run when in a bare repo.
Diffstat (limited to 'Command/Watch.hs')
-rw-r--r--Command/Watch.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Command/Watch.hs b/Command/Watch.hs
index eb70ef6b1..25b5c6bba 100644
--- a/Command/Watch.hs
+++ b/Command/Watch.hs
@@ -13,7 +13,7 @@ import Command
import Option
def :: [Command]
-def = [withOptions [foregroundOption, stopOption] $
+def = [notBareRepo $ withOptions [foregroundOption, stopOption] $
command "watch" paramNothing seek "watch for changes"]
seek :: [CommandSeek]
@@ -28,7 +28,7 @@ stopOption :: Option
stopOption = Option.flag [] "stop" "stop daemon"
start :: Bool -> Bool -> Bool -> CommandStart
-start assistant foreground stopdaemon = notBareRepo $ do
+start assistant foreground stopdaemon = do
if stopdaemon
then stopDaemon
else startDaemon assistant foreground Nothing -- does not return