Fix use of several config settings

annex.ssh-options, annex.rsync-options, annex.bup-split-options.

And adjust types to avoid the bugs that broke several config settings
recently. Now "annex." prefixing is enforced at the type level.
This commit is contained in:
Joey Hess 2012-05-05 20:15:32 -04:00
parent 657d09d499
commit f7d8982672
10 changed files with 49 additions and 33 deletions

View file

@ -74,14 +74,14 @@ hookEnv k f = Just $ fileenv f ++ keyenv
lookupHook :: String -> String -> Annex (Maybe String)
lookupHook hooktype hook =do
command <- getConfig hookname ""
command <- getConfig (annexConfig hookname) ""
if null command
then do
warning $ "missing configuration for " ++ hookname
return Nothing
else return $ Just command
where
hookname = "annex." ++ hooktype ++ "-" ++ hook ++ "-hook"
hookname = 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