diff options
Diffstat (limited to 'Remote/Hook.hs')
-rw-r--r-- | Remote/Hook.hs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Remote/Hook.hs b/Remote/Hook.hs index 1e5c27b91..1c87823ca 100644 --- a/Remote/Hook.hs +++ b/Remote/Hook.hs @@ -30,7 +30,7 @@ remote = RemoteType { gen :: Git.Repo -> UUID -> Maybe RemoteConfig -> Annex Remote gen r u c = do - hooktype <- getConfig r "hooktype" (error "missing hooktype") + hooktype <- getRemoteConfig r "hooktype" (error "missing hooktype") cst <- remoteCost r expensiveRemoteCost return $ encryptableRemote c (storeEncrypted hooktype) @@ -74,15 +74,14 @@ hookEnv k f = Just $ fileenv f ++ keyenv lookupHook :: String -> String -> Annex (Maybe String) lookupHook hooktype hook =do - g <- gitRepo - command <- getConfig g hookname "" + command <- getConfig hookname "" if null command then do warning $ "missing configuration for " ++ hookname return Nothing else return $ Just command where - hookname = hooktype ++ "-" ++ hook ++ "-hook" + hookname = "annex." ++ hooktype ++ "-" ++ hook ++ "-hook" runHook :: String -> String -> Key -> Maybe FilePath -> Annex Bool -> Annex Bool runHook hooktype hook k f a = maybe (return False) run =<< lookupHook hooktype hook |