diff options
author | Joey Hess <joey@kitenet.net> | 2011-01-26 15:37:16 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-01-26 15:37:16 -0400 |
commit | 268cb35e644754093db003aee08d050a1f3f9466 (patch) | |
tree | c00319c584a9ad020027eebc1af2e1a525a55473 /Command/Semitrust.hs | |
parent | f7e3d6eea2f71efe14c3ccb29ef4e88840384d02 (diff) |
implement 3 level trust storage in trust.log
Diffstat (limited to 'Command/Semitrust.hs')
-rw-r--r-- | Command/Semitrust.hs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Command/Semitrust.hs b/Command/Semitrust.hs new file mode 100644 index 000000000..8ed95f5a3 --- /dev/null +++ b/Command/Semitrust.hs @@ -0,0 +1,35 @@ +{- git-annex command + - + - Copyright 2010 Joey Hess <joey@kitenet.net> + - + - Licensed under the GNU GPL version 3 or higher. + -} + +module Command.Semitrust where + +import Command +import qualified GitRepo as Git +import qualified Remotes +import UUID +import Trust +import Messages + +command :: [Command] +command = [Command "semitrust" (paramRepeating paramRemote) seek + "return repository to default trust level"] + +seek :: [CommandSeek] +seek = [withString start] + +{- Marks a remote as not trusted. -} +start :: CommandStartString +start name = do + r <- Remotes.byName name + showStart "untrust" name + return $ Just $ perform r + +perform :: Git.Repo -> CommandPerform +perform repo = do + uuid <- getUUID repo + trustSet uuid SemiTrusted + return $ Just $ return True |