support annex-config-uuid when generating remote

This is used by a special remote with sameas-uuid=
The remote's uuid is the sameas-uuid, but it needs to get
its RemoteConfig from the annex-config-uuid.
This commit is contained in:
Joey Hess 2019-10-11 12:32:11 -04:00
parent 0dd5691951
commit 2bd6e81bb0
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 2 additions and 3 deletions

View file

@ -105,7 +105,8 @@ remoteGen :: M.Map UUID RemoteConfig -> RemoteType -> Git.Repo -> Annex (Maybe R
remoteGen m t g = do
u <- getRepoUUID g
gc <- Annex.getRemoteGitConfig g
let c = fromMaybe M.empty $ M.lookup u m
let cu = fromMaybe u $ remoteAnnexConfigUUID gc
let c = fromMaybe M.empty $ M.lookup cu m
generate t g u c gc >>= \case
Nothing -> return Nothing
Just r -> Just <$> adjustExportImport (adjustReadOnly (addHooks r))

View file

@ -34,8 +34,6 @@ the remote.log. Eg, "B sameas=A foo=bar ..."
Implementation notes:
Next, need to make generating a Remote look at annex-config-uuid.
Need to get enableremote working for sameas.
Deal with the per-remote state issue.