don't try to use ssh connection caching for non-ssh urls
This commit is contained in:
parent
1040ef5474
commit
a0ef99b3f9
1 changed files with 16 additions and 12 deletions
28
Annex/Ssh.hs
28
Annex/Ssh.hs
|
@ -250,18 +250,22 @@ inRepoWithSshCachingTo remote a =
|
||||||
- and set sshCachingEnv so that git-annex will know what socket
|
- and set sshCachingEnv so that git-annex will know what socket
|
||||||
- file to use. -}
|
- file to use. -}
|
||||||
sshCachingTo :: Git.Repo -> Git.Repo -> Annex Git.Repo
|
sshCachingTo :: Git.Repo -> Git.Repo -> Annex Git.Repo
|
||||||
sshCachingTo remote g = case Git.Url.hostuser remote of
|
sshCachingTo remote g
|
||||||
Nothing -> return g
|
| not (Git.repoIsUrl remote) || Git.repoIsHttp remote = uncached
|
||||||
Just host -> do
|
| otherwise = case Git.Url.hostuser remote of
|
||||||
(msockfile, _) <- sshInfo (host, Git.Url.port remote)
|
Nothing -> uncached
|
||||||
case msockfile of
|
Just host -> do
|
||||||
Nothing -> return g
|
(msockfile, _) <- sshInfo (host, Git.Url.port remote)
|
||||||
Just sockfile -> do
|
case msockfile of
|
||||||
command <- liftIO readProgramFile
|
Nothing -> return g
|
||||||
prepSocket sockfile
|
Just sockfile -> do
|
||||||
liftIO $ do
|
command <- liftIO readProgramFile
|
||||||
g' <- addGitEnv g sshCachingEnv sockfile
|
prepSocket sockfile
|
||||||
addGitEnv g' "GIT_SSH" command
|
liftIO $ do
|
||||||
|
g' <- addGitEnv g sshCachingEnv sockfile
|
||||||
|
addGitEnv g' "GIT_SSH" command
|
||||||
|
where
|
||||||
|
uncached = return g
|
||||||
|
|
||||||
runSshCaching :: [String] -> String -> IO ()
|
runSshCaching :: [String] -> String -> IO ()
|
||||||
runSshCaching args sockfile = do
|
runSshCaching args sockfile = do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue