Fix bug that sometimes prevented git-annex smudge --clean from consuming all its input, which resulted in git add bypassing git-annex.

This commit is contained in:
Joey Hess 2016-05-02 10:53:24 -04:00
parent 67951cdd7c
commit 617f2834fc
Failed to extract signature
4 changed files with 59 additions and 2 deletions

View file

@ -73,8 +73,13 @@ clean file = do
if isJust (parseLinkOrPointer b)
then liftIO $ B.hPut stdout b
else ifM (shouldAnnex file)
( liftIO . emitPointer
=<< go =<< ingest =<< lockDown cfg file
( do
-- Even though we ingest the actual file,
-- and not stdin, we need to consume all
-- stdin, or git will get annoyed.
B.length b `seq` return ()
liftIO . emitPointer
=<< go =<< ingest =<< lockDown cfg file
, liftIO $ B.hPut stdout b
)
stop