From 6edaabd0407287becda24904ed19413a5371979c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 12 Dec 2011 13:43:52 -0400 Subject: reinject: Add a sanity check for using an annexed file as the source file. --- Command/Reinject.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Command/Reinject.hs') 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 -- cgit v1.2.3