diff options
Diffstat (limited to 'Command/Unlock.hs')
-rw-r--r-- | Command/Unlock.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Command/Unlock.hs b/Command/Unlock.hs index 6489fc333..5a0e6efeb 100644 --- a/Command/Unlock.hs +++ b/Command/Unlock.hs @@ -39,12 +39,12 @@ perform dest key = do tmpdest <- fromRepo $ gitAnnexTmpLocation key liftIO $ createDirectoryIfMissing True (parentDir tmpdest) showAction "copying" - ok <- liftIO $ copyFileExternal src tmpdest - if ok - then do + ifM (liftIO $ copyFileExternal src tmpdest) + ( do liftIO $ do removeFile dest moveFile tmpdest dest thawContent dest next $ return True - else error "copy failed!" + , error "copy failed!" + ) |