summaryrefslogtreecommitdiff
path: root/Command/Smudge.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-12-04 16:46:00 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-12-04 16:46:00 -0400
commit4a85a2f85858b18a03d78d59d2268dfefc74f6fc (patch)
treeba1f47cefbfc58336c9cb58afe725193302dc611 /Command/Smudge.hs
parent6e7468e9e142b379e0323d59f33c334b59c922fa (diff)
comments
Diffstat (limited to 'Command/Smudge.hs')
-rw-r--r--Command/Smudge.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/Command/Smudge.hs b/Command/Smudge.hs
index 07a3e1805..ddf81af43 100644
--- a/Command/Smudge.hs
+++ b/Command/Smudge.hs
@@ -39,6 +39,8 @@ seek :: SmudgeOptions -> CommandSeek
seek o = commandAction $
(if cleanOption o then clean else smudge) (smudgeFile o)
+-- Smudge filter is fed git file content, and if it's a pointer, should
+-- emit the annex object content.
smudge :: FilePath -> CommandStart
smudge _file = do
liftIO $ fileEncoding stdin
@@ -53,6 +55,8 @@ smudge _file = do
=<< catchMaybeIO (B.readFile content)
stop
+-- Clean filter decides if a file should be stored in the annex, and
+-- outputs a pointer to its injested content.
clean :: FilePath -> CommandStart
clean file = do
ifM (shouldAnnex file)