annex.largefiles support for clean filter
authorJoey Hess <joeyh@joeyh.name>
Fri, 4 Dec 2015 18:10:18 +0000 (14:10 -0400)
committerJoey Hess <joeyh@joeyh.name>
Fri, 4 Dec 2015 18:10:18 +0000 (14:10 -0400)
Command/Clean.hs

index 0a8e438d1deb2b5508d949fc92dcd2edee1b8c73..1793ddedb78152be3fa54b02b09f8ecfb7e8b70e 100644 (file)
@@ -11,6 +11,7 @@ import Common.Annex
 import Command
 import Annex.Content
 import Annex.MetaData
+import Annex.FileMatcher
 import Types.KeySource
 import Types.Key
 import Backend
@@ -39,8 +40,9 @@ start [] = error "clean filter run without filename; upgrade git"
 start _ = error "clean filter passed multiple filenames"
 
 shouldAnnex :: FilePath -> Annex Bool
-shouldAnnex _ = return True
--- TODO check annex.largefiles
+shouldAnnex file = do
+       matcher <- largeFilesMatcher
+       checkFileMatcher matcher file
 
 ingest :: FilePath -> Annex Key
 ingest file = do
@@ -54,7 +56,7 @@ ingest file = do
                <$> genKey source backend
        -- Hard link (or copy) file content to annex
        -- to prevent it from being lost when git checks out
-       -- a branch not contaning this file.
+       -- a branch not containing this file.
        unlessM (linkAnnex k file) $
                error "Problem adding file to the annex"
        genMetaData k file