aboutsummaryrefslogtreecommitdiff
path: root/Command/Reinject.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-12-12 13:43:52 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-12-12 13:43:52 -0400
commit6edaabd0407287becda24904ed19413a5371979c (patch)
treeaa212b82e752651419cf3166b228990a76b44676 /Command/Reinject.hs
parent79345ad5fc10fc96dcd3599f2e092b3967291549 (diff)
reinject: Add a sanity check for using an annexed file as the source file.
Diffstat (limited to 'Command/Reinject.hs')
-rw-r--r--Command/Reinject.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Command/Reinject.hs b/Command/Reinject.hs
index cfa0655ef..906f7c517 100644
--- a/Command/Reinject.hs
+++ b/Command/Reinject.hs
@@ -24,8 +24,9 @@ start :: [FilePath] -> CommandStart
start (src:dest:[])
| src == dest = stop
| otherwise = do
- showStart "reinject" dest
- next $ whenAnnexed (perform src) dest
+ ifAnnexed src
+ (error $ "cannot used annexed file as src: " ++ src)
+ (next $ whenAnnexed (perform src) dest)
start _ = error "specify a src file and a dest file"
perform :: FilePath -> FilePath -> (Key, Backend Annex) -> CommandPerform