summaryrefslogtreecommitdiff
path: root/Assistant/MakeRemote.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-05-30 14:49:25 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-05-30 14:50:44 -0400
commit5576c2035710948842f4b2d2063bc4dcebf090b8 (patch)
treee4eb30d87ad247742251a093e2b9b0eb03b5dcf9 /Assistant/MakeRemote.hs
parent15284e1696e9c881a1824ea3be45c65a92369e05 (diff)
fix UI when enabling existing gcrypt repo
avoid editing repo for same reasons as in 52601eb6067037e197b5c0b56c257482d968b465 avoid stomping on its description, even though no description exists until after syncing is complete
Diffstat (limited to 'Assistant/MakeRemote.hs')
-rw-r--r--Assistant/MakeRemote.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/Assistant/MakeRemote.hs b/Assistant/MakeRemote.hs
index 41be3275c..967a4d41d 100644
--- a/Assistant/MakeRemote.hs
+++ b/Assistant/MakeRemote.hs
@@ -90,19 +90,23 @@ enableSpecialRemote name remotetype mcreds config = do
r <- Command.InitRemote.findExisting name
case r of
Nothing -> error $ "Cannot find a special remote named " ++ name
- Just (u, c) -> setupSpecialRemote name remotetype config mcreds (Just u, c)
+ Just (u, c) -> setupSpecialRemote' False name remotetype config mcreds (Just u, c)
setupSpecialRemote :: RemoteName -> RemoteType -> R.RemoteConfig -> Maybe CredPair -> (Maybe UUID, R.RemoteConfig) -> Annex RemoteName
-setupSpecialRemote name remotetype config mcreds (mu, c) = do
+setupSpecialRemote = setupSpecialRemote' True
+
+setupSpecialRemote' :: Bool -> RemoteName -> RemoteType -> R.RemoteConfig -> Maybe CredPair -> (Maybe UUID, R.RemoteConfig) -> Annex RemoteName
+setupSpecialRemote' setdesc name remotetype config mcreds (mu, c) = do
{- Currently, only 'weak' ciphers can be generated from the
- assistant, because otherwise GnuPG may block once the entropy
- pool is drained, and as of now there's no way to tell the user
- to perform IO actions to refill the pool. -}
(c', u) <- R.setup remotetype mu mcreds $
M.insert "highRandomQuality" "false" $ M.union config c
- whenM (isNothing . M.lookup u <$> uuidMap) $
- describeUUID u name
configSet u c'
+ when setdesc $
+ whenM (isNothing . M.lookup u <$> uuidMap) $
+ describeUUID u name
return name
{- Returns the name of the git remote it created. If there's already a