diff options
Diffstat (limited to 'Config.hs')
-rw-r--r-- | Config.hs | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -95,3 +95,16 @@ configureSmudgeFilter :: Annex () configureSmudgeFilter = do setConfig (ConfigKey "filter.annex.smudge") "git-annex smudge %f" setConfig (ConfigKey "filter.annex.clean") "git-annex smudge --clean %f" + lf <- Annex.fromRepo Git.attributesLocal + gf <- Annex.fromRepo Git.attributes + lfs <- readattr lf + gfs <- readattr gf + liftIO $ unless ("filter=annex" `isInfixOf` (lfs ++ gfs)) $ do + createDirectoryIfMissing True (takeDirectory lf) + writeFile lf (lfs ++ "\n" ++ stdattr) + where + readattr = liftIO . catchDefaultIO "" . readFileStrictAnyEncoding + stdattr = unlines + [ "* filter=annex" + , ".* !filter" + ] |