summaryrefslogtreecommitdiff
path: root/Command/DropUnused.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-07-25 19:39:44 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-07-25 19:50:44 -0400
commit62a2644d670e61ac8f6d6d24c49c640d00ba097d (patch)
tree9972252146482821da75761bd4222539d271d37d /Command/DropUnused.hs
parent4d7d3fde4d7594d34a6951ce6c5a24ca11111739 (diff)
dropunused behavior change: Now refuses to drop the last copy of a file, unless you use the --force.
This was the last place in git-annex that could remove data referred to by the git history, without being forced. Like drop, dropunused checks remotes, and honors the global annex.numcopies setting. (However, .gitattributes settings cannot apply to unused files.)
Diffstat (limited to 'Command/DropUnused.hs')
-rw-r--r--Command/DropUnused.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/Command/DropUnused.hs b/Command/DropUnused.hs
index 687a38a04..bf2635e00 100644
--- a/Command/DropUnused.hs
+++ b/Command/DropUnused.hs
@@ -32,9 +32,8 @@ perform key = maybe droplocal dropremote =<< Remote.byNameWithUUID =<< from
where
dropremote r = do
showAction $ "from " ++ Remote.name r
- ok <- Remote.removeKey r key
- next $ Command.Drop.cleanupRemote key r ok
- droplocal = Command.Drop.performLocal key (Just 0) Nothing -- force drop
+ Command.Drop.performRemote key Nothing r
+ droplocal = Command.Drop.performLocal key Nothing Nothing
from = Annex.getField $ Option.name Command.Drop.fromOption
performOther :: (Key -> Git.Repo -> FilePath) -> Key -> CommandPerform