diff options
author | Joey Hess <joey@kitenet.net> | 2011-10-31 16:46:51 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-10-31 17:22:55 -0400 |
commit | 3d2a9f84051e9dc705ba4bb4828af691e479ae0e (patch) | |
tree | f99ff17d8fa860d1dcf2c8ebd8552e1e80bda8b3 /Command/DropKey.hs | |
parent | 00988bcf369671bdc3b78e95e3c2ae43f4835b1c (diff) |
cleanup
Diffstat (limited to 'Command/DropKey.hs')
-rw-r--r-- | Command/DropKey.hs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Command/DropKey.hs b/Command/DropKey.hs index d00bb6c83..cac955b4a 100644 --- a/Command/DropKey.hs +++ b/Command/DropKey.hs @@ -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 |