Improve behavior when unable to parse a preferred content expression (thanks, ion).

Fall back to "present" as the preferred conent expression, which will
not result in any content movement.
This commit is contained in:
Joey Hess 2014-03-20 00:10:12 -04:00
parent 9aa31b71f3
commit ed30b81e2c
4 changed files with 38 additions and 12 deletions

View file

@ -120,7 +120,10 @@ addIn s = addLimit =<< mk
{- Limit to content that is currently present on a uuid. -}
limitPresent :: Maybe UUID -> MkLimit
limitPresent u _ = Right $ const $ checkKey $ \key -> do
limitPresent u _ = Right $ matchPresent u
matchPresent :: Maybe UUID -> MatchFiles
matchPresent u _ = checkKey $ \key -> do
hereu <- getUUID
if u == Just hereu || isNothing u
then inAnnex key