OSDN Git Service

Fix when setting ssh client is null. GIT_SSH environment variable is not clear
[tortoisegit/TortoiseGitJp.git] / src / Git / Git.cpp
index f000ef0..2b7be0d 100644 (file)
@@ -640,6 +640,18 @@ BOOL CGit::CheckMsysGitDir()
                free(home);\r
        }\r
 \r
+       //setup ssh client\r
+       CRegString sshclient=CRegString(_T("Software\\TortoiseGit\\SSH"));\r
+       CString ssh=sshclient;\r
+\r
+       if(!ssh.IsEmpty())\r
+       {\r
+               _tputenv_s(_T("GIT_SSH"),ssh);\r
+       }else\r
+       {\r
+               _tputenv_s(_T("GIT_SSH"),_T(""));\r
+       }\r
+\r
        // search PATH if git/bin directory is alredy present\r
        if ( FindGitPath() )\r
        {\r
@@ -680,15 +692,6 @@ BOOL CGit::CheckMsysGitDir()
        free(oldpath);\r
 \r
 \r
-     //setup ssh client\r
-       CRegString sshclient=CRegString(_T("Software\\TortoiseGit\\SSH"));\r
-       CString ssh=sshclient;\r
-\r
-       if(!ssh.IsEmpty())\r
-       {\r
-               _tputenv_s(_T("GIT_SSH"),ssh);\r
-       }\r
-\r
     if( !FindGitPath() )\r
        {\r
                return false;\r