summaryrefslogtreecommitdiff
path: root/Trust.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-01-26 16:20:28 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-01-26 16:20:28 -0400
commit7f6af79232eee685daf58e72737c5284f80cf482 (patch)
treee3ec0e7612845e056df355c6841ee9a58e603d52 /Trust.hs
parent7b2da21ab7bc51785203a69cc05ab811a8629ecb (diff)
trust setting improvements
Diffstat (limited to 'Trust.hs')
-rw-r--r--Trust.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/Trust.hs b/Trust.hs
index 9474d47d7..695059a93 100644
--- a/Trust.hs
+++ b/Trust.hs
@@ -73,6 +73,8 @@ trustMapParse s = M.fromList $ map pair $ filter (not . null) $ lines s
{- Changes the trust level for a uuid in the trustLog, and commits it. -}
trustSet :: UUID -> TrustLevel -> Annex ()
trustSet uuid level = do
+ when (null uuid) $
+ error "unknown UUID; cannot modify trust level"
m <- trustMap
when (M.lookup uuid m /= Just level) $ do
let m' = M.insert uuid level m