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:
Joey Hess 2019-10-10 12:48:26 -04:00
parent 46071a2435
commit 92ff30df70
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 45 additions and 24 deletions

View file

@ -35,6 +35,7 @@ module Remote.Helper.Special (
import Annex.Common
import qualified Annex
import Annex.SpecialRemote.Config
import Types.StoreRetrieve
import Types.Remote
import Crypto
@ -72,6 +73,9 @@ gitConfigSpecialRemote u c cfgs = do
forM_ cfgs $ \(k, v) ->
setConfig (remoteConfig c k) v
storeUUIDIn (remoteConfig c "uuid") u
case M.lookup sameasUUIDKey c of
Nothing -> noop
Just sameasuuid -> setConfig (remoteConfig c "config-uuid") sameasuuid
-- RetrievalVerifiableKeysSecure unless overridden by git config.
--