This commit is contained in:
Joey Hess 2011-10-31 16:46:51 -04:00
parent 00988bcf36
commit 3d2a9f8405
11 changed files with 48 additions and 54 deletions

View file

@ -23,14 +23,16 @@ seek = [withKeys start]
start :: Key -> CommandStart
start key = do
present <- inAnnex key
force <- Annex.getState Annex.force
if not present
then stop
else if not force
then error "dropkey is can cause data loss; use --force if you're sure you want to do this"
else do
showStart "dropkey" (show key)
next $ perform key
else do
checkforced
showStart "dropkey" (show key)
next $ perform key
where
checkforced =
unlessM (Annex.getState Annex.force) $
error "dropkey can cause data loss; use --force if you're sure you want to do this"
perform :: Key -> CommandPerform
perform key = do