git-annex/RemoteDaemon/Transport/GCrypt.hs
Joey Hess c2f612292a
start splitting out readonly values from AnnexState
Values in AnnexRead can be read more efficiently, without MVar overhead.
Only a few things have been moved into there, and the performance
increase so far is not likely to be noticable.

This is groundwork for putting more stuff in there, particularly a value
that indicates if debugging is enabled.

The obvious next step is to change option parsing to not run in the
Annex monad to set values in AnnexState, and instead return a pure value
that gets stored in AnnexRead.
2021-04-02 15:51:44 -04:00

28 lines
802 B
Haskell

{- git-remote-daemon, gcrypt transport
-
- Copyright 2015 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU AGPL version 3 or higher.
-}
module RemoteDaemon.Transport.GCrypt (transport) where
import Annex.Common
import RemoteDaemon.Types
import RemoteDaemon.Common
import RemoteDaemon.Transport.Ssh (transportUsingCmd)
import Git.GCrypt
import Remote.Helper.Ssh
import Remote.GCrypt (accessShellConfig)
import Annex.Ssh
transport :: Transport
transport rr@(RemoteRepo r gc) url h@(TransportHandle (LocalRepo g) _ _) ichan ochan
| accessShellConfig gc = do
r' <- encryptedRemote g r
v <- liftAnnex h $ git_annex_shell ConsumeStdin r' "notifychanges" [] []
case v of
Nothing -> noop
Just (cmd, params) ->
transportUsingCmd cmd params rr url h ichan ochan
| otherwise = noop