aboutsummaryrefslogtreecommitdiff
path: root/Logs/PreferredContent.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-10 16:04:28 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-10 16:04:28 -0400
commit7053033f7708c2e432b3ad3e62356bd395932899 (patch)
tree2b0c617c4e9a4a2e42aee458ee1c4d3421b63d18 /Logs/PreferredContent.hs
parent7d6bea416ac6ef0abd900fdb2b941c79168cbb48 (diff)
add standard group selector to repo edit form
Diffstat (limited to 'Logs/PreferredContent.hs')
-rw-r--r--Logs/PreferredContent.hs9
1 files changed, 3 insertions, 6 deletions
diff --git a/Logs/PreferredContent.hs b/Logs/PreferredContent.hs
index ed6dbb43e..840c36155 100644
--- a/Logs/PreferredContent.hs
+++ b/Logs/PreferredContent.hs
@@ -29,7 +29,7 @@ import Annex.UUID
import Git.FilePath
import Types.Group
import Logs.Group
-import Annex.StandardGroups
+import Types.StandardGroups
{- Filename of preferred-content.log. -}
preferredContentLog :: FilePath
@@ -89,12 +89,9 @@ makeMatcher groupmap u s
{- Standard matchers are pre-defined for some groups. If none is defined,
- or a repository is in multiple groups with standard matchers, match all. -}
standardMatcher :: GroupMap -> UUID -> Utility.Matcher.Matcher MatchFiles
-standardMatcher groupmap u =
- maybe matchAll findmatcher $ u `M.lookup` groupsByUUID groupmap
+standardMatcher m u = maybe matchAll use (getStandardGroup u m)
where
- findmatcher s = case catMaybes $ map toStandardGroup $ S.toList s of
- [g] -> makeMatcher groupmap u $ preferredContent g
- _ -> matchAll
+ use = makeMatcher m u . preferredContent
matchAll :: Utility.Matcher.Matcher MatchFiles
matchAll = Utility.Matcher.generate []