diff options
Diffstat (limited to 'Command/Reinject.hs')
-rw-r--r-- | Command/Reinject.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Command/Reinject.hs b/Command/Reinject.hs index 63309aa52..3de24f3fc 100644 --- a/Command/Reinject.hs +++ b/Command/Reinject.hs @@ -21,9 +21,11 @@ seek :: [CommandSeek] seek = [withWords start] start :: [FilePath] -> CommandStart -start (src:dest:[]) = do - showStart "reinject" dest - next $ perform src dest +start (src:dest:[]) + | src == dest = stop + | otherwise = do + showStart "reinject" dest + next $ perform src dest start _ = error "specify a src file and a dest file" perform :: FilePath -> FilePath -> CommandPerform @@ -36,9 +38,7 @@ perform src dest = isAnnexed dest $ \(key, backend) -> do -- moveToObjectDir; disk space is also -- checked this way. move key = getViaTmp key $ \tmp -> - if dest /= src - then liftIO $ boolSystem "mv" [File src, File tmp] - else return True + liftIO $ boolSystem "mv" [File src, File tmp] cleanup :: Key -> Backend Annex -> CommandCleanup cleanup key backend = do |