aboutsummaryrefslogtreecommitdiff
path: root/Command/Smudge.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-12-04 17:18:26 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-12-04 17:18:26 -0400
commit93eaf6d6d018fe9df5b985e47300f549e4b04709 (patch)
tree72051f058433906d9d0f5a946b6cdd75d905e978 /Command/Smudge.hs
parent4a85a2f85858b18a03d78d59d2268dfefc74f6fc (diff)
refactor
Diffstat (limited to 'Command/Smudge.hs')
-rw-r--r--Command/Smudge.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/Command/Smudge.hs b/Command/Smudge.hs
index ddf81af43..70a318c2d 100644
--- a/Command/Smudge.hs
+++ b/Command/Smudge.hs
@@ -39,8 +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 filter is fed git file content, and if it's a pointer to an
+-- available annex object, should output its content.
smudge :: FilePath -> CommandStart
smudge _file = do
liftIO $ fileEncoding stdin
@@ -63,10 +63,13 @@ clean file = do
( do
k <- ingest file
liftIO $ emitPointer k
- , liftIO $ B.hGetContents stdin >>= B.hPut stdout -- cat file
+ , liftIO cat
)
stop
+cat :: IO ()
+cat = B.hGetContents stdin >>= B.hPut stdout
+
shouldAnnex :: FilePath -> Annex Bool
shouldAnnex file = do
matcher <- largeFilesMatcher