diff options
author | 2015-02-12 15:44:10 -0400 | |
---|---|---|
committer | 2015-02-12 15:44:10 -0400 | |
commit | 3653b408156fa8d251bb233e29dd27da05d5db72 (patch) | |
tree | b82f6a0a46fa37f340eada83f9f3f838b1807492 /Annex/Ssh.hs | |
parent | 329267cb2b11da52956a86d9caec5225251a5ac1 (diff) |
The ssh-options git config is now used by gcrypt, rsync, and ddar special remotes that use ssh as a transport.
Diffstat (limited to 'Annex/Ssh.hs')
-rw-r--r-- | Annex/Ssh.hs | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs index 84637fd3d..1be735c8f 100644 --- a/Annex/Ssh.hs +++ b/Annex/Ssh.hs @@ -1,6 +1,6 @@ {- git-annex ssh interface, with connection caching - - - Copyright 2012-2014 Joey Hess <id@joeyh.name> + - Copyright 2012-2015 Joey Hess <id@joeyh.name> - - Licensed under the GNU GPL version 3 or higher. -} @@ -8,7 +8,7 @@ {-# LANGUAGE CPP #-} module Annex.Ssh ( - sshCachingOptions, + sshOptions, sshCacheDir, sshReadPort, forceSshCleanup, @@ -41,20 +41,26 @@ import Utility.LockFile #endif {- Generates parameters to ssh to a given host (or user@host) on a given - - port, with connection caching. -} -sshCachingOptions :: (String, Maybe Integer) -> [CommandParam] -> Annex [CommandParam] -sshCachingOptions (host, port) opts = go =<< sshInfo (host, port) + - port. This includes connection caching parameters, and any ssh-options. -} +sshOptions :: (String, Maybe Integer) -> RemoteGitConfig -> [CommandParam] -> Annex [CommandParam] +sshOptions (host, port) gc opts = go =<< sshCachingInfo (host, port) where go (Nothing, params) = ret params go (Just socketfile, params) = do prepSocket socketfile ret params - ret ps = return $ ps ++ opts ++ portParams port ++ [Param "-T"] + ret ps = return $ concat + [ ps + , map Param (remoteAnnexSshOptions gc) + , opts + , portParams port + , [Param "-T"] + ] {- Returns a filename to use for a ssh connection caching socket, and - parameters to enable ssh connection caching. -} -sshInfo :: (String, Maybe Integer) -> Annex (Maybe FilePath, [CommandParam]) -sshInfo (host, port) = go =<< sshCacheDir +sshCachingInfo :: (String, Maybe Integer) -> Annex (Maybe FilePath, [CommandParam]) +sshCachingInfo (host, port) = go =<< sshCacheDir where go Nothing = return (Nothing, []) go (Just dir) = do @@ -256,7 +262,7 @@ sshCachingTo remote g | otherwise = case Git.Url.hostuser remote of Nothing -> uncached Just host -> do - (msockfile, _) <- sshInfo (host, Git.Url.port remote) + (msockfile, _) <- sshCachingInfo (host, Git.Url.port remote) case msockfile of Nothing -> return g Just sockfile -> do |