break module dependancy loop

A PITA but worth it to clean up the trust configuration code.
This commit is contained in:
Joey Hess 2012-01-10 13:11:16 -04:00
parent 0d5c402210
commit 07cacbeee9
10 changed files with 109 additions and 107 deletions

View file

@ -12,8 +12,6 @@ import qualified Git
import qualified Git.Config
import qualified Git.Command
import qualified Annex
import qualified Logs.Trust
import Types.TrustLevel
type ConfigKey = String
@ -85,6 +83,5 @@ getNumCopies v = perhaps (use v) =<< Annex.getState Annex.forcenumcopies
config = "annex.numcopies"
{- Gets the trust level set for a remote in git config. -}
getTrustLevel :: Git.Repo -> Annex (Maybe TrustLevel)
getTrustLevel r = maybe Nothing Logs.Trust.trustName <$>
fromRepo (Git.Config.getMaybe (remoteConfig r "trustlevel"))
getTrustLevel :: Git.Repo -> Annex (Maybe String)
getTrustLevel r = fromRepo $ Git.Config.getMaybe $ remoteConfig r "trustlevel"