summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-12-04 14:20:32 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-12-04 14:20:32 -0400
commita9c942b0e0924786951e934335b864b708d3cc38 (patch)
tree1e569b0778151e79c5ae9b943ae7ba3731e37a3a /Command
parentc44cfeb472284b06c4ed15578181a151b3571402 (diff)
clean filter should update location log when adding new content to annex
Diffstat (limited to 'Command')
-rw-r--r--Command/Clean.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/Command/Clean.hs b/Command/Clean.hs
index 1793ddedb..15dcdfacb 100644
--- a/Command/Clean.hs
+++ b/Command/Clean.hs
@@ -15,11 +15,12 @@ import Annex.FileMatcher
import Types.KeySource
import Types.Key
import Backend
+import Logs.Location
import qualified Data.ByteString.Lazy as B
cmd :: Command
-cmd = dontCheck repoExists $
+cmd = noMessages $ dontCheck repoExists $
command "clean" SectionPlumbing
"git clean filter"
paramFile (withParams seek)
@@ -57,8 +58,11 @@ ingest file = do
-- Hard link (or copy) file content to annex
-- to prevent it from being lost when git checks out
-- a branch not containing this file.
- unlessM (linkAnnex k file) $
- error "Problem adding file to the annex"
+ r <- linkAnnex k file
+ case r of
+ LinkAnnexFailed -> error "Problem adding file to the annex"
+ LinkAnnexOk -> logStatus k InfoPresent
+ LinkAnnexNoop -> noop
genMetaData k file
=<< liftIO (getFileStatus file)
return k