avoid clean filter trying to annex a pointer file
This commit is contained in:
parent
751120c171
commit
ba39f993f5
1 changed files with 13 additions and 12 deletions
|
@ -54,22 +54,23 @@ smudge file = do
|
||||||
=<< catchMaybeIO (B.readFile content)
|
=<< catchMaybeIO (B.readFile content)
|
||||||
stop
|
stop
|
||||||
|
|
||||||
-- Clean filter decides if a file should be stored in the annex, and
|
-- Clean filter is fed file content on stdin, decides if a file
|
||||||
-- outputs a pointer to its injested content.
|
-- should be stored in the annex, and outputs a pointer to its
|
||||||
|
-- injested content.
|
||||||
clean :: FilePath -> CommandStart
|
clean :: FilePath -> CommandStart
|
||||||
clean file = do
|
clean file = do
|
||||||
ifM (shouldAnnex file)
|
b <- liftIO $ B.hGetContents stdin
|
||||||
( do
|
if isJust (parseLinkOrPointer b)
|
||||||
k <- ingest file
|
then liftIO $ B.hPut stdout b
|
||||||
updateAssociatedFiles k file
|
else ifM (shouldAnnex file)
|
||||||
liftIO $ emitPointer k
|
( do
|
||||||
, liftIO cat
|
k <- ingest file
|
||||||
)
|
updateAssociatedFiles k file
|
||||||
|
liftIO $ emitPointer k
|
||||||
|
, liftIO $ B.hPut stdout b
|
||||||
|
)
|
||||||
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