add sameas inherited configs to newConfig

This makes initremote --sameas work with encryption inherited.
This commit is contained in:
Joey Hess 2019-10-11 12:45:30 -04:00
parent 2bd6e81bb0
commit 91eed85fd4
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 46 additions and 35 deletions

View file

@ -15,6 +15,7 @@ import qualified Remote
import qualified Logs.Remote
import qualified Types.Remote as R
import Logs.UUID
import Logs.Remote
import Types.GitConfig
cmd :: Command
@ -57,14 +58,14 @@ start o (name:ws) = ifM (isJust <$> findExisting name)
(pure Nothing)
(Just . Sameas <$$> getParsed)
(sameas o)
let c = newConfig name sameasuuid
t <- either giveup return (findType config)
c <- newConfig name sameasuuid
(Logs.Remote.keyValToConfig ws)
<$> readRemoteLog
t <- either giveup return (findType c)
starting "initremote" (ActionItemOther (Just name)) $
perform t name $ M.union config c
perform t name c
)
)
where
config = Logs.Remote.keyValToConfig ws
perform :: RemoteType -> String -> R.RemoteConfig -> CommandPerform
perform t name c = do