enableremote: Fix re-enabling of existing gcrypt remotes, so that eg, encryption key changes take effect.
They were silently ignored, a reversion introduced in 6.20160527. I don't like this regular git remote special case in enableremote, but I can't see a way to get rid of it. So, check if the existing remote is a Remote.Git This commit was sponsored by Trenton Cronholm on Patreon.
This commit is contained in:
parent
f406d16525
commit
99984967eb
2 changed files with 24 additions and 12 deletions
|
@ -14,6 +14,9 @@ git-annex (6.20170322) UNRELEASED; urgency=medium
|
||||||
the parameters that git passes.
|
the parameters that git passes.
|
||||||
* enableremote: When enabling a non-special remote, param=value
|
* enableremote: When enabling a non-special remote, param=value
|
||||||
parameters can't be used, so error out if any are provided.
|
parameters can't be used, so error out if any are provided.
|
||||||
|
* enableremote: Fix re-enabling of existing gcrypt remotes, so
|
||||||
|
that eg, encryption key changes take effect. They were silently
|
||||||
|
ignored, a reversion introduced in 6.20160527.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Wed, 29 Mar 2017 12:41:46 -0400
|
-- Joey Hess <id@joeyh.name> Wed, 29 Mar 2017 12:41:46 -0400
|
||||||
|
|
||||||
|
|
|
@ -39,19 +39,28 @@ start (name:rest) = go =<< filter matchingname <$> Annex.fromRepo Git.remotes
|
||||||
matchingname r = Git.remoteName r == Just name
|
matchingname r = Git.remoteName r == Just name
|
||||||
go [] = startSpecialRemote name (Logs.Remote.keyValToConfig rest)
|
go [] = startSpecialRemote name (Logs.Remote.keyValToConfig rest)
|
||||||
=<< Annex.SpecialRemote.findExisting name
|
=<< Annex.SpecialRemote.findExisting name
|
||||||
go (r:_)
|
go (r:_) = do
|
||||||
| null rest = startNormalRemote name r
|
-- This could be either a normal git remote or a special
|
||||||
| otherwise = giveup $
|
-- remote that has an url (eg gcrypt).
|
||||||
"That is a normal git remote; passing these parameters does not make sense: " ++ unwords rest
|
rs <- Remote.remoteList
|
||||||
|
case filter (\rmt -> Remote.name rmt == name) rs of
|
||||||
|
(rmt:_) | Remote.remotetype rmt == Remote.Git.remote ->
|
||||||
|
startNormalRemote name rest r
|
||||||
|
_ -> go []
|
||||||
|
|
||||||
startNormalRemote :: Git.RemoteName -> Git.Repo -> CommandStart
|
-- Normal git remotes are special-cased; enableremote retries probing
|
||||||
startNormalRemote name r = do
|
-- the remote uuid.
|
||||||
showStart "enableremote" name
|
startNormalRemote :: Git.RemoteName -> [String] -> Git.Repo -> CommandStart
|
||||||
next $ next $ do
|
startNormalRemote name restparams r
|
||||||
setRemoteIgnore r False
|
| null restparams = do
|
||||||
r' <- Remote.Git.configRead False r
|
showStart "enableremote" name
|
||||||
u <- getRepoUUID r'
|
next $ next $ do
|
||||||
return $ u /= NoUUID
|
setRemoteIgnore r False
|
||||||
|
r' <- Remote.Git.configRead False r
|
||||||
|
u <- getRepoUUID r'
|
||||||
|
return $ u /= NoUUID
|
||||||
|
| otherwise = giveup $
|
||||||
|
"That is a normal git remote; passing these parameters does not make sense: " ++ unwords restparams
|
||||||
|
|
||||||
startSpecialRemote :: Git.RemoteName -> Remote.RemoteConfig -> Maybe (UUID, Remote.RemoteConfig) -> CommandStart
|
startSpecialRemote :: Git.RemoteName -> Remote.RemoteConfig -> Maybe (UUID, Remote.RemoteConfig) -> CommandStart
|
||||||
startSpecialRemote name config Nothing = do
|
startSpecialRemote name config Nothing = do
|
||||||
|
|
Loading…
Reference in a new issue