when annex.largefiles parse fails, say where the config came from

This commit is contained in:
Joey Hess 2019-12-20 13:07:10 -04:00
parent 945be47b48
commit 8e9e809d9b
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -210,21 +210,21 @@ largeFilesMatcher :: Annex GetFileMatcher
largeFilesMatcher = go =<< getGitConfigVal' annexLargeFiles largeFilesMatcher = go =<< getGitConfigVal' annexLargeFiles
where where
go (HasGitConfig (Just expr)) = do go (HasGitConfig (Just expr)) = do
matcher <- mkmatcher expr matcher <- mkmatcher expr "git config"
return $ const $ return matcher return $ const $ return matcher
go v = return $ \file -> do go v = return $ \file -> do
expr <- checkAttr "annex.largefiles" file expr <- checkAttr "annex.largefiles" file
if null expr || expr == unspecifiedAttr if null expr || expr == unspecifiedAttr
then case v of then case v of
HasGlobalConfig (Just expr') -> HasGlobalConfig (Just expr') ->
mkmatcher expr' mkmatcher expr' "git-annex config"
_ -> return matchAll _ -> return matchAll
else mkmatcher expr else mkmatcher expr "gitattributes"
mkmatcher expr = do mkmatcher expr cfgfrom = do
parser <- mkLargeFilesParser parser <- mkLargeFilesParser
either badexpr return $ parsedToMatcher $ parser expr either (badexpr cfgfrom) return $ parsedToMatcher $ parser expr
badexpr e = giveup $ "bad annex.largefiles configuration: " ++ e badexpr cfgfrom e = giveup $ "bad annex.largefiles configuration in " ++ cfgfrom ++ ": " ++ e
simply :: MatchFiles Annex -> ParseResult (MatchFiles Annex) simply :: MatchFiles Annex -> ParseResult (MatchFiles Annex)
simply = Right . Operation simply = Right . Operation