don't let users change encryption type once remote is initted

This commit is contained in:
Joey Hess 2011-04-16 19:45:59 -04:00
parent d2e74efdb2
commit 98e3817466

View file

@ -23,7 +23,8 @@ encryptionSetup :: RemoteConfig -> Annex RemoteConfig
encryptionSetup c =
case (M.lookup "encryption" c, extractCipher c) of
(Nothing, Nothing) -> error "Specify encryption=key or encryption=none"
(Just "none", _) -> return c
(Just "none", Nothing) -> return c
(Just "none", Just _) -> error "Cannot change encryption type of existing remote."
(Nothing, Just _) -> return c
(Just _, Nothing) -> use $ genCipher c
(Just _, Just v) -> use $ updateCipher c v