summaryrefslogtreecommitdiff
path: root/Command/SetKey.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/SetKey.hs')
-rw-r--r--Command/SetKey.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Command/SetKey.hs b/Command/SetKey.hs
index 02118fb14..d5762dd8c 100644
--- a/Command/SetKey.hs
+++ b/Command/SetKey.hs
@@ -31,13 +31,14 @@ mkKey = fromMaybe (error "bad key") . file2key
perform :: FilePath -> Key -> CommandPerform
perform file key = do
- -- the file might be on a different filesystem, so mv is used
+ -- the file might be on a different filesystem, so moveFile is used
-- rather than simply calling moveAnnex; disk space is also
-- checked this way.
ok <- getViaTmp key $ \dest ->
if dest /= file
- then liftIO $
- boolSystem "mv" [File file, File dest]
+ then liftIO $ catchBoolIO $ do
+ moveFile file dest
+ return True
else return True
if ok
then next $ cleanup key