git-annex/Command/Trust.hs

36 lines
718 B
Haskell
Raw Normal View History

2010-12-28 21:44:55 +00:00
{- git-annex command
-
- Copyright 2010 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Command.Trust where
import Command
import qualified GitRepo as Git
import qualified Remotes
import Trust
2010-12-28 21:44:55 +00:00
import UUID
import Messages
command :: [Command]
command = [repoCommand "trust" (paramRepeating paramRemote) seek
"trust a repository"]
seek :: [CommandSeek]
2010-12-28 21:44:55 +00:00
seek = [withString start]
start :: CommandStartString
start name = notBareRepo $ do
2010-12-28 21:44:55 +00:00
showStart "trust" name
2011-01-26 20:20:28 +00:00
Remotes.readConfigs
r <- Remotes.byName name
2010-12-28 21:44:55 +00:00
return $ Just $ perform r
perform :: Git.Repo -> CommandPerform
2010-12-28 21:44:55 +00:00
perform repo = do
uuid <- getUUID repo
trustSet uuid Trusted
2010-12-28 21:44:55 +00:00
return $ Just $ return True