enableremote: When enabling a non-special remote, param=value parameters can't be used, so error out if any are provided.

This commit was sponsored by Riku Voipio.
This commit is contained in:
Joey Hess 2017-04-07 13:14:53 -04:00
parent 20b634c82c
commit f406d16525
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 19 additions and 1 deletions

View file

@ -39,7 +39,10 @@ start (name:rest) = go =<< filter matchingname <$> Annex.fromRepo Git.remotes
matchingname r = Git.remoteName r == Just name
go [] = startSpecialRemote name (Logs.Remote.keyValToConfig rest)
=<< Annex.SpecialRemote.findExisting name
go (r:_) = startNormalRemote name r
go (r:_)
| null rest = startNormalRemote name r
| otherwise = giveup $
"That is a normal git remote; passing these parameters does not make sense: " ++ unwords rest
startNormalRemote :: Git.RemoteName -> Git.Repo -> CommandStart
startNormalRemote name r = do