From 4d0543932ea101053937b0f9b152d5b20e9381de Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 10 May 2024 14:40:38 -0400 Subject: [PATCH] pushEmpty: upload empty manifest --- CmdLine/GitRemoteAnnex.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CmdLine/GitRemoteAnnex.hs b/CmdLine/GitRemoteAnnex.hs index 38fce37e9c..b597b7ae1c 100644 --- a/CmdLine/GitRemoteAnnex.hs +++ b/CmdLine/GitRemoteAnnex.hs @@ -347,14 +347,15 @@ incrementalPush st rmt oldtrackingrefs newtrackingrefs = guardPush st $ do , findotherprereq' ref sha ls ) --- When the push deletes all refs from the remote, drop the manifest --- and all bundles that were listed in it. The manifest is dropped --- first so if this is interrupted, only unused bundles will remain in the --- remote, rather than leaving the remote with a manifest that refers to --- missing bundles. +-- When the push deletes all refs from the remote, upload an empty +-- manifest and then drop all bundles that were listed in it. +-- The manifest is emptired first so if this is interrupted, only +-- unused bundles will remain in the remote, rather than leaving the +-- remote with a manifest that refers to missing bundles. pushEmpty :: State -> Remote -> Annex (Bool, State) pushEmpty st rmt = do manifest <- maybe (downloadManifest rmt) pure (manifestCache st) + uploadManifest rmt (Manifest []) ok <- allM (dropKey rmt) (genManifestKey (Remote.uuid rmt) : inManifest manifest) return (ok, st { manifestCache = Nothing })