diff options
Diffstat (limited to 'Command/SetKey.hs')
-rw-r--r-- | Command/SetKey.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Command/SetKey.hs b/Command/SetKey.hs index 685872f73..55472ccae 100644 --- a/Command/SetKey.hs +++ b/Command/SetKey.hs @@ -35,7 +35,10 @@ perform :: FilePath -> Key -> SubCmdPerform perform file key = do -- the file might be on a different filesystem, so mv is used -- rather than simply calling moveToObjectDir key file - ok <- getViaTmp key $ \dest -> liftIO $ boolSystem "mv" [file, dest] + ok <- getViaTmp key $ \dest -> do + if dest /= file + then liftIO $ boolSystem "mv" [file, dest] + else return True if ok then return $ Just $ cleanup key else error "mv failed!" |