AssociatedFile newtype
To prevent any further mistakes like 301aff34c4
This commit was sponsored by Francois Marier on Patreon.
This commit is contained in:
parent
2cd7496210
commit
c8e1e3dada
43 changed files with 179 additions and 138 deletions
|
@ -44,13 +44,13 @@ type GetFileMatcher = FilePath -> Annex (FileMatcher Annex)
|
|||
checkFileMatcher :: GetFileMatcher -> FilePath -> Annex Bool
|
||||
checkFileMatcher getmatcher file = do
|
||||
matcher <- getmatcher file
|
||||
checkMatcher matcher Nothing (Just file) S.empty True
|
||||
checkMatcher matcher Nothing (AssociatedFile (Just file)) S.empty True
|
||||
|
||||
checkMatcher :: FileMatcher Annex -> Maybe Key -> AssociatedFile -> AssumeNotPresent -> Bool -> Annex Bool
|
||||
checkMatcher matcher mkey afile notpresent d
|
||||
| isEmpty matcher = return d
|
||||
| otherwise = case (mkey, afile) of
|
||||
(_, Just file) -> go =<< fileMatchInfo file
|
||||
(_, AssociatedFile (Just file)) -> go =<< fileMatchInfo file
|
||||
(Just key, _) -> go (MatchingKey key)
|
||||
_ -> return d
|
||||
where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue