From d23a240b2c63958d1d7c647383bccba2246c0db0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 9 Dec 2016 12:47:57 -0400 Subject: content removal is supposed to succed if the content was already not present --- P2P/Annex.hs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'P2P') diff --git a/P2P/Annex.hs b/P2P/Annex.hs index 93da9e69b..771a72126 100644 --- a/P2P/Annex.hs +++ b/P2P/Annex.hs @@ -91,10 +91,14 @@ runLocal runmode runner a = case a of Left e -> return (Left (show e)) Right result -> runner (next result) RemoveContent k next -> do - v <- tryNonAsync $ lockContentForRemoval k $ \contentlock -> do - removeAnnex contentlock - logStatus k InfoMissing - return True + v <- tryNonAsync $ + ifM (Annex.Content.inAnnex key) + ( lockContentForRemoval k $ \contentlock -> do + removeAnnex contentlock + logStatus k InfoMissing + return True + , return True + ) case v of Left e -> return (Left (show e)) Right result -> runner (next result) -- cgit v1.2.3