From 9f5b8638a990f8d163afaf62e15331515fdcb21f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 14 Oct 2014 14:10:22 -0400 Subject: vicfg: Deleting configurations now resets to the default, where before it has no effect. Added a Default instance for TrustLevel, and was able to use that to clear up several other parts of the code too. This commit was sponsored by Stephan Schulz --- Logs/Trust.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Logs') diff --git a/Logs/Trust.hs b/Logs/Trust.hs index 047a728f4..b880f44de 100644 --- a/Logs/Trust.hs +++ b/Logs/Trust.hs @@ -19,6 +19,7 @@ module Logs.Trust ( ) where import qualified Data.Map as M +import Data.Default import Common.Annex import Types.TrustLevel @@ -38,7 +39,7 @@ trustGet level = M.keys . M.filter (== level) <$> trustMap {- Returns the TrustLevel of a given repo UUID. -} lookupTrust :: UUID -> Annex TrustLevel -lookupTrust u = (fromMaybe SemiTrusted . M.lookup u) <$> trustMap +lookupTrust u = (fromMaybe def . M.lookup u) <$> trustMap {- Partitions a list of UUIDs to those matching a TrustLevel and not. -} trustPartition :: TrustLevel -> [UUID] -> Annex ([UUID], [UUID]) -- cgit v1.2.3