diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-05-02 10:53:24 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-05-02 10:53:24 -0400 |
commit | ef2feac946c7b61f29486a5554e0d5e8a4a5b4e7 (patch) | |
tree | 59ef658566c544caa7b6463b59c19ef8f1c94b28 /Command | |
parent | 6e795acaa5735491080c8bd77fbc67b921871a96 (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')
-rw-r--r-- | Command/Smudge.hs | 9 |
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 |