summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-12-04 14:10:18 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-12-04 14:10:18 -0400
commit6a91761052cfcb2a4d600f868a912040827fc051 (patch)
tree415e3437437c23b495a1114a76f24a8ce34c46d0 /Command
parent563e5613f28710d2e2dd56b0f06ef2714e9a14d2 (diff)
annex.largefiles support for clean filter
Diffstat (limited to 'Command')
-rw-r--r--Command/Clean.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/Command/Clean.hs b/Command/Clean.hs
index 0a8e438d1..1793ddedb 100644
--- a/Command/Clean.hs
+++ b/Command/Clean.hs
@@ -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