From c6884989dcd77e530631c15c9ed3f2fa3168ddb7 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 10 Aug 2018 16:24:06 -0400 Subject: [PATCH] capability reply must be a subset of what git sent so filter it --- Git/Protocol/LongRunningProcess.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Git/Protocol/LongRunningProcess.hs b/Git/Protocol/LongRunningProcess.hs index 877780df57..825270ef17 100644 --- a/Git/Protocol/LongRunningProcess.hs +++ b/Git/Protocol/LongRunningProcess.hs @@ -70,11 +70,11 @@ versionPkt = formatKV "version" fromVersion -- the Server. handshake :: (Role -> Either String Role) -- ^ role selection function - -> ([Capability] -> [Capability]) -- ^ capability selection function + -> (Capability -> Bool) -- ^ capability selection function -> Handle -- ^ handle to receive data from git -> Handle -- ^ handle to send data to git -> IO (Either String (Role, [Capability])) -handshake selectrole selectcapabilities input output = +handshake selectrole selectcapability input output = getpkt pktRole $ \role -> checkversion $ do case selectrole role of @@ -120,7 +120,7 @@ handshake selectrole selectcapabilities input output = "git is using an unsupported protocol version: " ++ show versions exchangecaps cnt = getpkts pktCapability $ \caps -> do - let mycaps = selectcapabilities caps + let mycaps = filter selectcapability caps sendpkts capabilityPkt mycaps $ cnt mycaps