From 2ff051dd2173e773dfda5d1f0bf6c6b407705580 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 15 Feb 2013 17:58:49 -0400 Subject: proper fix for dropunused Now getKeysPresent checks that the key's content, not only its directory, exists. In direct mode, the inode cache file is used as a standin for the content. removeAnnex always removes the inode cache file, and drop and move --from always call removeAnnex, even if the object does not seem to be inAnnex, to ensure it's always deleted. --- Command/Drop.hs | 2 +- Command/Move.hs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'Command') diff --git a/Command/Drop.hs b/Command/Drop.hs index f7491deae..1683f3b57 100644 --- a/Command/Drop.hs +++ b/Command/Drop.hs @@ -60,7 +60,7 @@ performLocal key numcopies knownpresentremote = lockContent key $ do untrusteduuids <- trustGet UnTrusted let tocheck = Remote.remotesWithoutUUID remotes (trusteduuids'++untrusteduuids) stopUnless (canDropKey key numcopies trusteduuids' tocheck []) $ do - whenM (inAnnex key) $ removeAnnex key + removeAnnex key next $ cleanupLocal key performRemote :: Key -> Maybe Int -> Remote -> CommandPerform diff --git a/Command/Move.hs b/Command/Move.hs index 316e4192e..20203c205 100644 --- a/Command/Move.hs +++ b/Command/Move.hs @@ -104,7 +104,7 @@ toPerform dest move key file = moveLock move key $ do Remote.logStatus dest key InfoPresent if move then do - whenM (inAnnex key) $ removeAnnex key + removeAnnex key next $ Command.Drop.cleanupLocal key else next $ return True -- cgit v1.2.3