summaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-04-13 21:39:04 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-04-13 21:39:04 -0400
commit65c7bfcc55ec2243e1f4dcb5bbca54dce494bc63 (patch)
tree99f6f077200a7330e17f7ca763cbc651ba959f9e /Annex
parent8050a0c517d15828e10232c91c60473d8c0a9917 (diff)
don't try to use ssh connection caching for non-ssh urls
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Ssh.hs28
1 files changed, 16 insertions, 12 deletions
diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs
index 06e3ac449..7ead526cb 100644
--- a/Annex/Ssh.hs
+++ b/Annex/Ssh.hs
@@ -250,18 +250,22 @@ inRepoWithSshCachingTo remote a =
- and set sshCachingEnv so that git-annex will know what socket
- file to use. -}
sshCachingTo :: Git.Repo -> Git.Repo -> Annex Git.Repo
-sshCachingTo remote g = case Git.Url.hostuser remote of
- Nothing -> return g
- Just host -> do
- (msockfile, _) <- sshInfo (host, Git.Url.port remote)
- case msockfile of
- Nothing -> return g
- Just sockfile -> do
- command <- liftIO readProgramFile
- prepSocket sockfile
- liftIO $ do
- g' <- addGitEnv g sshCachingEnv sockfile
- addGitEnv g' "GIT_SSH" command
+sshCachingTo remote g
+ | not (Git.repoIsUrl remote) || Git.repoIsHttp remote = uncached
+ | otherwise = case Git.Url.hostuser remote of
+ Nothing -> uncached
+ Just host -> do
+ (msockfile, _) <- sshInfo (host, Git.Url.port remote)
+ case msockfile of
+ Nothing -> return g
+ Just sockfile -> do
+ command <- liftIO readProgramFile
+ prepSocket sockfile
+ liftIO $ do
+ g' <- addGitEnv g sshCachingEnv sockfile
+ addGitEnv g' "GIT_SSH" command
+ where
+ uncached = return g
runSshCaching :: [String] -> String -> IO ()
runSshCaching args sockfile = do