rest of fix for GIT_SSH_COMMAND -n parameter

c8a6be7eef was incomplete
This commit is contained in:
Joey Hess 2017-03-20 23:35:29 -04:00
parent 217cdbe6c8
commit 6af15d0ec9
No known key found for this signature in database
GPG key ID: C910D9222512E3C7

View file

@ -54,11 +54,10 @@ data ConsumeStdin = ConsumeStdin | NoConsumeStdin
- port. This includes connection caching parameters, and any ssh-options. - port. This includes connection caching parameters, and any ssh-options.
- If GIT_SSH or GIT_SSH_COMMAND is set, they are used instead. -} - If GIT_SSH or GIT_SSH_COMMAND is set, they are used instead. -}
sshCommand :: ConsumeStdin -> (SshHost, Maybe SshPort) -> RemoteGitConfig -> SshCommand -> Annex (FilePath, [CommandParam]) sshCommand :: ConsumeStdin -> (SshHost, Maybe SshPort) -> RemoteGitConfig -> SshCommand -> Annex (FilePath, [CommandParam])
sshCommand cs (host, port) gc remotecmd = sshCommand cs (host, port) gc remotecmd = maybe go return
go =<< liftIO (gitSsh host port remotecmd) =<< liftIO (gitSsh' host port remotecmd (consumeStdinParams cs))
where where
go (Just (c, ps)) = return (c, consumeStdinParams cs ++ ps) go = do
go Nothing = do
ps <- sshOptions cs (host, port) gc [] ps <- sshOptions cs (host, port) gc []
return ("ssh", Param host:ps++[Param remotecmd]) return ("ssh", Param host:ps++[Param remotecmd])