From cbe12b9bc33a74f7e9edf651490c07b74f8689a3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 22 Jul 2022 11:36:21 -0400 Subject: [PATCH] force fully strict read of journal file again I was thinking that discardIncompleteAppend would make it strict, since it looks at the end of the bytestring. But, it's applied lazily.. This probably fixes windows, which was failing: git-annex.exe: .git\annex\journal\trust.log: DeleteFile "\\\\?\\C:\\Users\\runneradmin\\.t\\5\\tmprepo22\\.git\\annex\\journal\\trust.log": permission denied (The process cannot access the file because it is being used by another process.) --- Annex/Journal.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Annex/Journal.hs b/Annex/Journal.hs index db3c0a3587..249fb20037 100644 --- a/Annex/Journal.hs +++ b/Annex/Journal.hs @@ -196,8 +196,8 @@ getJournalFileStale (GetPrivate getprivate) file = do where jfile = journalFile file getfrom d = catchMaybeIO $ - discardIncompleteAppend - <$> L.readFile (fromRawFilePath (d P. jfile)) + discardIncompleteAppend . L.fromStrict + <$> B.readFile (fromRawFilePath (d P. jfile)) -- Note that this forces read of the whole lazy bytestring. discardIncompleteAppend :: L.ByteString -> L.ByteString -- 2.30.2