diff options
author | Joey Hess <joey@kitenet.net> | 2011-01-13 23:46:02 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-01-13 23:46:02 -0400 |
commit | c1839fdccb286cb5e83f0cf2d1d2d8e15226b0eb (patch) | |
tree | 7931bec9800f08ef61f52cb52feae10968d2fa0a /Command | |
parent | 23686cc63d38faf7fb4d66ece8cbeb5214b07e5f (diff) |
unlock: Fix behavior when file content is not present.
Diffstat (limited to 'Command')
-rw-r--r-- | Command/Unlock.hs | 9 |
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 |