aboutsummaryrefslogtreecommitdiff
path: root/Logs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-10-14 14:10:22 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-10-14 14:15:07 -0400
commit9f5b8638a990f8d163afaf62e15331515fdcb21f (patch)
tree51584af5c9bfe07e12703bf5dabc45bf776b57e3 /Logs
parent9433c62da3d0c7b45ba528f01e000630f999cb27 (diff)
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
Diffstat (limited to 'Logs')
-rw-r--r--Logs/Trust.hs3
1 files changed, 2 insertions, 1 deletions
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])