refactor
This commit is contained in:
parent
e8ca01cbc0
commit
fb6ebdaae7
1 changed files with 6 additions and 3 deletions
|
@ -39,8 +39,8 @@ seek :: SmudgeOptions -> CommandSeek
|
||||||
seek o = commandAction $
|
seek o = commandAction $
|
||||||
(if cleanOption o then clean else smudge) (smudgeFile o)
|
(if cleanOption o then clean else smudge) (smudgeFile o)
|
||||||
|
|
||||||
-- Smudge filter is fed git file content, and if it's a pointer, should
|
-- Smudge filter is fed git file content, and if it's a pointer to an
|
||||||
-- emit the annex object content.
|
-- available annex object, should output its content.
|
||||||
smudge :: FilePath -> CommandStart
|
smudge :: FilePath -> CommandStart
|
||||||
smudge _file = do
|
smudge _file = do
|
||||||
liftIO $ fileEncoding stdin
|
liftIO $ fileEncoding stdin
|
||||||
|
@ -63,10 +63,13 @@ clean file = do
|
||||||
( do
|
( do
|
||||||
k <- ingest file
|
k <- ingest file
|
||||||
liftIO $ emitPointer k
|
liftIO $ emitPointer k
|
||||||
, liftIO $ B.hGetContents stdin >>= B.hPut stdout -- cat file
|
, liftIO cat
|
||||||
)
|
)
|
||||||
stop
|
stop
|
||||||
|
|
||||||
|
cat :: IO ()
|
||||||
|
cat = B.hGetContents stdin >>= B.hPut stdout
|
||||||
|
|
||||||
shouldAnnex :: FilePath -> Annex Bool
|
shouldAnnex :: FilePath -> Annex Bool
|
||||||
shouldAnnex file = do
|
shouldAnnex file = do
|
||||||
matcher <- largeFilesMatcher
|
matcher <- largeFilesMatcher
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue