git-annex/Command/Trust.hs

32 lines
619 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
2011-10-05 20:02:51 +00:00
import Common.Annex
2010-12-28 21:44:55 +00:00
import Command
import qualified Remote
2011-10-15 20:21:08 +00:00
import Logs.Trust
2010-12-28 21:44:55 +00:00
def :: [Command]
def = [command "trust" (paramRepeating paramRemote) seek "trust a repository"]
seek :: [CommandSeek]
seek = [withWords start]
2010-12-28 21:44:55 +00:00
start :: [String] -> CommandStart
start ws = do
let name = unwords ws
2010-12-28 21:44:55 +00:00
showStart "trust" name
u <- Remote.nameToUUID name
2011-05-15 06:02:46 +00:00
next $ perform u
2010-12-28 21:44:55 +00:00
perform :: UUID -> CommandPerform
perform uuid = do
trustSet uuid Trusted
2011-05-15 06:02:46 +00:00
next $ return True