reinject: Add a sanity check for using an annexed file as the source file.
This commit is contained in:
parent
79345ad5fc
commit
6edaabd040
2 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue