summaryrefslogtreecommitdiff
path: root/Remote/Helper/Hooks.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-03-15 20:39:25 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-03-15 20:39:25 -0400
commitc0c9991c9f5322aef05f4c97d2c3f3bdc3101e46 (patch)
tree9cdd4f7913659329283e8d909fa7c4f98cc567f0 /Remote/Helper/Hooks.hs
parentff8b6c1bab519f243b67219cc2b43d037b3fa4e2 (diff)
nukes another 15 lines thanks to ifM
Diffstat (limited to 'Remote/Helper/Hooks.hs')
-rw-r--r--Remote/Helper/Hooks.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/Remote/Helper/Hooks.hs b/Remote/Helper/Hooks.hs
index 5929b1793..ed329b914 100644
--- a/Remote/Helper/Hooks.hs
+++ b/Remote/Helper/Hooks.hs
@@ -84,10 +84,8 @@ runHooks r starthook stophook a = do
liftIO $ closeFd fd
lookupHook :: Remote -> String -> Annex (Maybe String)
-lookupHook r n = do
- command <- getConfig (repo r) hookname ""
- if null command
- then return Nothing
- else return $ Just command
+lookupHook r n = go =<< getConfig (repo r) hookname ""
where
+ go "" = return Nothing
+ go command = return $ Just command
hookname = n ++ "-command"