summaryrefslogtreecommitdiff
path: root/Command/Drop.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Drop.hs')
-rw-r--r--Command/Drop.hs12
1 files changed, 9 insertions, 3 deletions
diff --git a/Command/Drop.hs b/Command/Drop.hs
index 269c4c26b..71f19a828 100644
--- a/Command/Drop.hs
+++ b/Command/Drop.hs
@@ -78,12 +78,18 @@ performRemote :: Key -> AssociatedFile -> NumCopies -> Remote -> CommandPerform
performRemote key afile numcopies remote = lockContent key $ do
-- Filter the remote it's being dropped from out of the lists of
-- places assumed to have the key, and places to check.
- -- When the local repo has the key, that's one additional copy.
+ -- When the local repo has the key, that's one additional copy,
+ -- as long asthe local repo is not untrusted.
(remotes, trusteduuids) <- Remote.keyPossibilitiesTrusted key
present <- inAnnex key
u <- getUUID
- let have = filter (/= uuid) $
- if present then u:trusteduuids else trusteduuids
+ trusteduuids' <- if present
+ then ifM ((<= SemiTrusted) <$> lookupTrust u)
+ ( pure (u:trusteduuids)
+ , pure trusteduuids
+ )
+ else pure trusteduuids
+ let have = filter (/= uuid) trusteduuids'
untrusteduuids <- trustGet UnTrusted
let tocheck = filter (/= remote) $
Remote.remotesWithoutUUID remotes (have++untrusteduuids)