include all remotes back in
This commit is contained in:
parent
1100e0d3c9
commit
650a631ef8
9 changed files with 31 additions and 27 deletions
|
@ -11,6 +11,7 @@ import Annex.Common
|
|||
import Types.Remote
|
||||
import Types.Creds
|
||||
import qualified Git
|
||||
import Git.Types (fromConfigKey)
|
||||
import Config
|
||||
import Config.Cost
|
||||
import Annex.UUID
|
||||
|
@ -107,19 +108,19 @@ hookEnv action k f = Just <$> mergeenv (fileenv f ++ keyenv)
|
|||
|
||||
lookupHook :: HookName -> Action -> Annex (Maybe String)
|
||||
lookupHook hookname action = do
|
||||
command <- getConfig (annexConfig hook) ""
|
||||
command <- decodeBS' <$> getConfig hook mempty
|
||||
if null command
|
||||
then do
|
||||
fallback <- getConfig (annexConfig hookfallback) ""
|
||||
fallback <- decodeBS' <$> getConfig hookfallback mempty
|
||||
if null fallback
|
||||
then do
|
||||
warning $ "missing configuration for " ++ hook ++ " or " ++ hookfallback
|
||||
warning $ "missing configuration for " ++ fromConfigKey hook ++ " or " ++ fromConfigKey hookfallback
|
||||
return Nothing
|
||||
else return $ Just fallback
|
||||
else return $ Just command
|
||||
where
|
||||
hook = hookname ++ "-" ++ action ++ "-hook"
|
||||
hookfallback = hookname ++ "-hook"
|
||||
hook = annexConfig $ encodeBS' $ hookname ++ "-" ++ action ++ "-hook"
|
||||
hookfallback = annexConfig $ encodeBS' $ hookname ++ "-hook"
|
||||
|
||||
runHook :: HookName -> Action -> Key -> Maybe FilePath -> Annex Bool -> Annex Bool
|
||||
runHook hook action k f a = maybe (return False) run =<< lookupHook hook action
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue