From c1839fdccb286cb5e83f0cf2d1d2d8e15226b0eb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 13 Jan 2011 23:46:02 -0400 Subject: unlock: Fix behavior when file content is not present. --- Command/Unlock.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Command') 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 -- cgit v1.2.3