remotedaemon: Fixed support for notifications of changes to gcrypt remotes, which was never tested and didn't quite work before.

This commit is contained in:
Joey Hess 2015-03-16 15:28:29 -04:00
parent 3f83e5181f
commit 707293ba7e
7 changed files with 84 additions and 26 deletions

View file

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