From 8e9e809d9badd8178218ab21faef13967c8a91f5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 20 Dec 2019 13:07:10 -0400 Subject: [PATCH] when annex.largefiles parse fails, say where the config came from --- Annex/FileMatcher.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Annex/FileMatcher.hs b/Annex/FileMatcher.hs index 1abbf91176..6b118c1f3a 100644 --- a/Annex/FileMatcher.hs +++ b/Annex/FileMatcher.hs @@ -210,21 +210,21 @@ largeFilesMatcher :: Annex GetFileMatcher largeFilesMatcher = go =<< getGitConfigVal' annexLargeFiles where go (HasGitConfig (Just expr)) = do - matcher <- mkmatcher expr + matcher <- mkmatcher expr "git config" return $ const $ return matcher go v = return $ \file -> do expr <- checkAttr "annex.largefiles" file if null expr || expr == unspecifiedAttr then case v of HasGlobalConfig (Just expr') -> - mkmatcher expr' + mkmatcher expr' "git-annex config" _ -> return matchAll - else mkmatcher expr + else mkmatcher expr "gitattributes" - mkmatcher expr = do + mkmatcher expr cfgfrom = do parser <- mkLargeFilesParser - either badexpr return $ parsedToMatcher $ parser expr - badexpr e = giveup $ "bad annex.largefiles configuration: " ++ e + either (badexpr cfgfrom) return $ parsedToMatcher $ parser expr + badexpr cfgfrom e = giveup $ "bad annex.largefiles configuration in " ++ cfgfrom ++ ": " ++ e simply :: MatchFiles Annex -> ParseResult (MatchFiles Annex) simply = Right . Operation