diff options
Diffstat (limited to 'Annex/Ssh.hs')
-rw-r--r-- | Annex/Ssh.hs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Annex/Ssh.hs b/Annex/Ssh.hs index 4d54d728e..276bac5a4 100644 --- a/Annex/Ssh.hs +++ b/Annex/Ssh.hs @@ -266,7 +266,7 @@ inRepoWithSshOptionsTo remote gc a = - to set GIT_SSH=git-annex, and sets sshOptionsEnv. -} sshOptionsTo :: Git.Repo -> RemoteGitConfig -> Git.Repo -> Annex Git.Repo sshOptionsTo remote gc g - | not (Git.repoIsUrl remote) || Git.repoIsHttp remote = uncached + | not (Git.repoIsUrl remote) || Git.repoIsHttp remote = unchanged | otherwise = case Git.Url.hostuser remote of Nothing -> uncached Just host -> do @@ -277,17 +277,21 @@ sshOptionsTo remote gc g prepSocket sockfile use (sshConnectionCachingParams sockfile) where - uncached = return g + unchanged = return g use opts = do - let val = toSshOptionsEnv $ concat + let sshopts = [ opts , map Param (remoteAnnexSshOptions gc) ] - command <- liftIO programPath - liftIO $ do - g' <- addGitEnv g sshOptionsEnv val - addGitEnv g' "GIT_SSH" command + if null sshopts + then unchanged + else do + let val = toSshOptionsEnv (concat sshopts) + command <- liftIO programPath + liftIO $ do + g' <- addGitEnv g sshOptionsEnv val + addGitEnv g' "GIT_SSH" command runSshOptions :: [String] -> String -> IO () runSshOptions args s = do |