summaryrefslogtreecommitdiff
path: root/Command/Unlock.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/Unlock.hs')
-rw-r--r--Command/Unlock.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Command/Unlock.hs b/Command/Unlock.hs
index 0e55585ae..7c1625bf0 100644
--- a/Command/Unlock.hs
+++ b/Command/Unlock.hs
@@ -12,6 +12,7 @@ import System.Directory hiding (copyFile)
import Command
import qualified Annex
+import qualified Backend
import Types
import Messages
import Locations
@@ -31,8 +32,12 @@ seek = [withFilesInGit start]
- content. -}
start :: CommandStartString
start file = isAnnexed file $ \(key, _) -> do
- showStart "unlock" file
- return $ Just $ perform file key
+ inbackend <- Backend.hasKey key
+ if not inbackend
+ then return Nothing
+ else do
+ showStart "unlock" file
+ return $ Just $ perform file key
perform :: FilePath -> Key -> CommandPerform
perform dest key = do