summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
Diffstat (limited to 'Command')
-rw-r--r--Command/Unlock.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/Command/Unlock.hs b/Command/Unlock.hs
index 8cc72f3a3..19a1b258f 100644
--- a/Command/Unlock.hs
+++ b/Command/Unlock.hs
@@ -26,12 +26,17 @@ seek = withFilesInGit $ whenAnnexed start
{- The unlock subcommand replaces the symlink with a copy of the file's
- content. -}
start :: FilePath -> Key -> CommandStart
-start file key = stopUnless (inAnnex key) $ do
+start file key = do
showStart "unlock" file
- ifM (checkDiskSpace Nothing key 0)
- ( next $ perform file key
+ ifM (inAnnex key)
+ ( ifM (checkDiskSpace Nothing key 0)
+ ( next $ perform file key
+ , do
+ warning "not enough disk space to copy file"
+ next $ next $ return False
+ )
, do
- warning "not enough disk space to copy file"
+ warning "content not present; cannot unlock"
next $ next $ return False
)