summaryrefslogtreecommitdiff
path: root/Logs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-04-03 17:01:40 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-04-03 17:01:40 -0400
commitf768f16999d997077be98c0d8eabd3d85fd8caa5 (patch)
tree40ff7020f523d3eb67f344a983af4a6d7c0aca26 /Logs
parent6543d5406c64bb00a58e74305ec9ca09a49faf0b (diff)
detect when unwanted remote is empty and remove it
Needs fixes to build when the webapp is disabled.
Diffstat (limited to 'Logs')
-rw-r--r--Logs/Group.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Logs/Group.hs b/Logs/Group.hs
index c08feffde..85906f0a7 100644
--- a/Logs/Group.hs
+++ b/Logs/Group.hs
@@ -13,6 +13,7 @@ module Logs.Group (
groupMap,
groupMapLoad,
getStandardGroup,
+ inUnwantedGroup
) where
import qualified Data.Map as M
@@ -74,3 +75,7 @@ getStandardGroup :: S.Set Group -> Maybe StandardGroup
getStandardGroup s = case mapMaybe toStandardGroup $ S.toList s of
[g] -> Just g
_ -> Nothing
+
+inUnwantedGroup :: UUID -> Annex Bool
+inUnwantedGroup u = elem UnwantedGroup
+ . mapMaybe toStandardGroup . S.toList <$> lookupGroups u