diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-08-04 15:27:48 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-08-04 15:27:48 -0400 |
commit | 6b0ee8a9721eaf8a62b187e9b52c21269b630301 (patch) | |
tree | 234b71017e2f531ae219ee24c3d45ad6ac95c53c | |
parent | 058e0e562ca14bcc4953ca449c26ef5ae6122b40 (diff) |
Windows: Fix bug that caused git-annex sync to fail due to missing environment variable.
I think that the problem was caused by windows not having a concept of an
env var that is set, but to the empty string. So, GIT_ANNEX_SSHOPTION
got set to "" and was not seen as set at all.
Easy fix, which also makes git-annex sync a little faster is to not set
GIT_SSH, when GIT_ANNEX_SSHOPTION has no options. Might as well let git use
ssh per usual in this case, no need to run git-annex as the proxy ssh
command..
-rw-r--r-- | Annex/Ssh.hs | 18 | ||||
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | doc/bugs/git-annex_sync_under_windows_fails_by_using_itself_as_the_ssh_command.mdwn | 2 |
3 files changed, 15 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 diff --git a/debian/changelog b/debian/changelog index d5ad1ccae..1f951dec5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,6 +17,8 @@ git-annex (5.20150732) UNRELEASED; urgency=medium make the proxied command fail the same way. * proxy: Fix removal of files deleted by the proxied command. * proxy: Fix behavior when run in subdirectory of git repo. + * Windows: Fix bug that caused git-annex sync to fail due to missing + environment variable. -- Joey Hess <id@joeyh.name> Fri, 31 Jul 2015 12:31:39 -0400 diff --git a/doc/bugs/git-annex_sync_under_windows_fails_by_using_itself_as_the_ssh_command.mdwn b/doc/bugs/git-annex_sync_under_windows_fails_by_using_itself_as_the_ssh_command.mdwn index edfa5f1bd..0b219457e 100644 --- a/doc/bugs/git-annex_sync_under_windows_fails_by_using_itself_as_the_ssh_command.mdwn +++ b/doc/bugs/git-annex_sync_under_windows_fails_by_using_itself_as_the_ssh_command.mdwn @@ -213,3 +213,5 @@ C:\data_organization\data> """]] + +> [[fixed|done]] I think. --[[Joey]] |