diff options
author | Joey Hess <joey@kitenet.net> | 2011-03-27 16:55:43 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-03-27 16:55:43 -0400 |
commit | 30f427700f9e9d59a83775a049e670cc05f2dee6 (patch) | |
tree | 224bdc04fbe08ed02d3801354bbfca8b75b7f4f8 /Command | |
parent | 3470260a8500b42f805b8263af9c73b99706bb92 (diff) |
converted several commands to use Remote
only move and map still to convert
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Describe.hs | 14 | ||||
-rw-r--r-- | Command/Semitrust.hs | 13 | ||||
-rw-r--r-- | Command/Trust.hs | 13 | ||||
-rw-r--r-- | Command/Untrust.hs | 13 |
4 files changed, 20 insertions, 33 deletions
diff --git a/Command/Describe.hs b/Command/Describe.hs index 32aef4f24..9e98a8143 100644 --- a/Command/Describe.hs +++ b/Command/Describe.hs @@ -7,10 +7,8 @@ module Command.Describe where - import Command -import qualified GitRepo as Git -import qualified Remotes +import qualified Remote import UUID import Messages import qualified Command.Init @@ -30,12 +28,10 @@ start params = notBareRepo $ do _ -> error "Specify a repository and a description." showStart "describe" name - Remotes.readConfigs - r <- Remotes.byName name - return $ Just $ perform r description + u <- Remote.nameToUUID name + return $ Just $ perform u description -perform :: Git.Repo -> String -> CommandPerform -perform repo description = do - u <- getUUID repo +perform :: UUID -> String -> CommandPerform +perform u description = do describeUUID u description return $ Just $ Command.Init.cleanup diff --git a/Command/Semitrust.hs b/Command/Semitrust.hs index 351336b89..e64d418f8 100644 --- a/Command/Semitrust.hs +++ b/Command/Semitrust.hs @@ -8,8 +8,7 @@ module Command.Semitrust where import Command -import qualified GitRepo as Git -import qualified Remotes +import qualified Remote import UUID import Trust import Messages @@ -24,12 +23,10 @@ seek = [withString start] start :: CommandStartString start name = notBareRepo $ do showStart "semitrust" name - Remotes.readConfigs - r <- Remotes.byName name - return $ Just $ perform r + u <- Remote.nameToUUID name + return $ Just $ perform u -perform :: Git.Repo -> CommandPerform -perform repo = do - uuid <- getUUID repo +perform :: UUID -> CommandPerform +perform uuid = do trustSet uuid SemiTrusted return $ Just $ return True diff --git a/Command/Trust.hs b/Command/Trust.hs index f7dba5648..05505cd04 100644 --- a/Command/Trust.hs +++ b/Command/Trust.hs @@ -8,8 +8,7 @@ module Command.Trust where import Command -import qualified GitRepo as Git -import qualified Remotes +import qualified Remote import Trust import UUID import Messages @@ -24,12 +23,10 @@ seek = [withString start] start :: CommandStartString start name = notBareRepo $ do showStart "trust" name - Remotes.readConfigs - r <- Remotes.byName name - return $ Just $ perform r + u <- Remote.nameToUUID name + return $ Just $ perform u -perform :: Git.Repo -> CommandPerform -perform repo = do - uuid <- getUUID repo +perform :: UUID -> CommandPerform +perform uuid = do trustSet uuid Trusted return $ Just $ return True diff --git a/Command/Untrust.hs b/Command/Untrust.hs index 9c11efe46..311ec6eeb 100644 --- a/Command/Untrust.hs +++ b/Command/Untrust.hs @@ -8,8 +8,7 @@ module Command.Untrust where import Command -import qualified GitRepo as Git -import qualified Remotes +import qualified Remote import UUID import Trust import Messages @@ -24,12 +23,10 @@ seek = [withString start] start :: CommandStartString start name = notBareRepo $ do showStart "untrust" name - Remotes.readConfigs - r <- Remotes.byName name - return $ Just $ perform r + u <- Remote.nameToUUID name + return $ Just $ perform u -perform :: Git.Repo -> CommandPerform -perform repo = do - uuid <- getUUID repo +perform :: UUID -> CommandPerform +perform uuid = do trustSet uuid UnTrusted return $ Just $ return True |