fix editing unknown uuid

Before, assumed Nothing when getting remote meant it was the local repo,
and showed the edit form for that.
This commit is contained in:
Joey Hess 2013-11-05 12:38:54 -04:00
parent 564da7946c
commit dfe3162bf5

View file

@ -37,6 +37,7 @@ import Git.Remote
import Remote.Helper.Encryptable (extractCipher)
import Types.Crypto
import Utility.Gpg
import Annex.UUID
import qualified Data.Text as T
import qualified Data.Map as M
@ -178,6 +179,9 @@ postEditNewCloudRepositoryR uuid = xmppNeeded >> editForm True uuid
editForm :: Bool -> UUID -> Handler Html
editForm new uuid = page "Edit repository" (Just Configuration) $ do
mremote <- liftAnnex $ Remote.remoteFromUUID uuid
when (mremote == Nothing) $
whenM ((/=) uuid <$> liftAnnex getUUID) $
error "unknown remote"
curr <- liftAnnex $ getRepoConfig uuid mremote
liftAnnex $ checkAssociatedDirectory curr mremote
((result, form), enctype) <- liftH $