summaryrefslogtreecommitdiff
path: root/Command/XMPPGit.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Command/XMPPGit.hs')
-rw-r--r--Command/XMPPGit.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/Command/XMPPGit.hs b/Command/XMPPGit.hs
index ca7058c12..9df4f5d66 100644
--- a/Command/XMPPGit.hs
+++ b/Command/XMPPGit.hs
@@ -20,5 +20,22 @@ seek = [withWords start]
start :: [String] -> CommandStart
start _ = do
+ liftIO gitRemoteHelper
liftIO xmppGitRelay
stop
+
+{- A basic implementation of the git-remote-helpers protocol. -}
+gitRemoteHelper :: IO ()
+gitRemoteHelper = do
+ expect "capabilities"
+ respond ["connect"]
+ expect "connect git-receive-pack"
+ respond []
+ where
+ expect s = do
+ cmd <- getLine
+ unless (cmd == s) $
+ error $ "git-remote-helpers protocol error: expected: " ++ s ++ ", but got: " ++ cmd
+ respond l = do
+ mapM_ putStrLn l
+ putStrLn ""