aboutsummaryrefslogtreecommitdiff
path: root/Command/Reinject.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-10-31 16:46:51 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-10-31 17:22:55 -0400
commit3d2a9f84051e9dc705ba4bb4828af691e479ae0e (patch)
treef99ff17d8fa860d1dcf2c8ebd8552e1e80bda8b3 /Command/Reinject.hs
parent00988bcf369671bdc3b78e95e3c2ae43f4835b1c (diff)
cleanup
Diffstat (limited to 'Command/Reinject.hs')
-rw-r--r--Command/Reinject.hs12
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