set annex-config-uuid when RemoteConfig contains a sameas-uuid
Initremote sets that, so after both initremote and enableremote, the git config will be set. Any remote that does not use Annex.SpecialRemote won't set annex-config-uuid. But that's only Remote.Git, which doesn't use RemoteConfig anyway.
This commit is contained in:
parent
46071a2435
commit
92ff30df70
5 changed files with 45 additions and 24 deletions
|
@ -8,6 +8,7 @@
|
|||
module Annex.SpecialRemote where
|
||||
|
||||
import Annex.Common
|
||||
import Annex.SpecialRemote.Config
|
||||
import Remote (remoteTypes, remoteMap)
|
||||
import Types.Remote (RemoteConfig, RemoteConfigKey, SetupStage(..), typename, setup)
|
||||
import Types.GitConfig
|
||||
|
@ -57,9 +58,6 @@ specialRemoteMap = do
|
|||
Nothing -> Nothing
|
||||
Just n -> Just (u, n)
|
||||
|
||||
lookupName :: RemoteConfig -> Maybe RemoteName
|
||||
lookupName c = M.lookup nameKey c <|> M.lookup sameasNameKey c
|
||||
|
||||
{- find the remote type -}
|
||||
findType :: RemoteConfig -> Either String RemoteType
|
||||
findType config = maybe unspecified specified $ M.lookup typeKey config
|
||||
|
@ -70,26 +68,6 @@ findType config = maybe unspecified specified $ M.lookup typeKey config
|
|||
(t:_) -> Right t
|
||||
findtype s i = typename i == s
|
||||
|
||||
{- The name of a configured remote is stored in its config using this key. -}
|
||||
nameKey :: RemoteConfigKey
|
||||
nameKey = "name"
|
||||
|
||||
{- The name of a sameas remote is stored using this key instead.
|
||||
- This prevents old versions of git-annex getting confused. -}
|
||||
sameasNameKey :: RemoteConfigKey
|
||||
sameasNameKey = "sameas-name"
|
||||
|
||||
{- The uuid that a sameas remote is the same as is stored in this key. -}
|
||||
sameasUUIDKey :: RemoteConfigKey
|
||||
sameasUUIDKey = "sameas-uuid"
|
||||
|
||||
{- The type of a remote is stored in its config using this key. -}
|
||||
typeKey :: RemoteConfigKey
|
||||
typeKey = "type"
|
||||
|
||||
autoEnableKey :: RemoteConfigKey
|
||||
autoEnableKey = "autoenable"
|
||||
|
||||
autoEnable :: Annex ()
|
||||
autoEnable = do
|
||||
remotemap <- M.filter configured <$> readRemoteLog
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue