summaryrefslogtreecommitdiff
path: root/Command/Smudge.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-05-02 10:53:24 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-05-02 10:53:24 -0400
commitef2feac946c7b61f29486a5554e0d5e8a4a5b4e7 (patch)
tree59ef658566c544caa7b6463b59c19ef8f1c94b28 /Command/Smudge.hs
parent6e795acaa5735491080c8bd77fbc67b921871a96 (diff)
Fix bug that sometimes prevented git-annex smudge --clean from consuming all its input, which resulted in git add bypassing git-annex.
Diffstat (limited to 'Command/Smudge.hs')
-rw-r--r--Command/Smudge.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Command/Smudge.hs b/Command/Smudge.hs
index 1e169c1bf..52367d499 100644
--- a/Command/Smudge.hs
+++ b/Command/Smudge.hs
@@ -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