From dc083bf8c820cc1ea6c6b1c1da3e01cd94b1bf67 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 21 May 2024 11:44:47 -0400 Subject: [PATCH] fix storing outManifest --- CmdLine/GitRemoteAnnex.hs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CmdLine/GitRemoteAnnex.hs b/CmdLine/GitRemoteAnnex.hs index a2ee9cdaca..1016d2482a 100644 --- a/CmdLine/GitRemoteAnnex.hs +++ b/CmdLine/GitRemoteAnnex.hs @@ -525,6 +525,13 @@ getEnabledSpecialRemoteByName remotename = maybe (return (Just rmt)) giveup (checkSpecialRemoteProblems rmt) +formatManifest :: Manifest -> B.ByteString +formatManifest manifest = + B8.unlines $ + map serializeKey' (inManifest manifest) + <> + map (\k -> "-" <> serializeKey' k) (outManifest manifest) + parseManifest :: B.ByteString -> Either String Manifest parseManifest b = let (outks, inks) = partitionEithers $ map parseline $ B8.lines b @@ -650,15 +657,13 @@ uploadManifest rmt manifest = do mkbak = genBackupManifestKey (Remote.uuid rmt) uploadfailed = giveup "Failed to upload manifest." - - manifestcontent = B8.unlines $ map serializeKey' (inManifest manifest) - + dropandput mk = do dropKey' rmt mk put mk put mk = withTmpFile "GITMANIFEST" $ \tmp tmph -> do - liftIO $ B8.hPut tmph manifestcontent + liftIO $ B8.hPut tmph (formatManifest manifest) liftIO $ hClose tmph -- storeKey needs the key to be in the annex objects -- directory, so put the manifest file there temporarily.