From: Frank Li Date: Fri, 14 Aug 2009 14:39:19 +0000 (+0800) Subject: Fixed Issue #137: Proxy Authentification fails X-Git-Url: http://git.sourceforge.jp/view?p=tortoisegit%2FTortoiseGitJp.git;a=commitdiff_plain;h=0812e2f3dd9ee69018fd0c3229c21498e040887c Fixed Issue #137: Proxy Authentification fails Signed-off-by: Frank Li --- diff --git a/src/Git/Git.cpp b/src/Git/Git.cpp index 46fc9bc..344312f 100644 --- a/src/Git/Git.cpp +++ b/src/Git/Git.cpp @@ -839,6 +839,32 @@ BOOL CGit::CheckMsysGitDir() CString str; #ifndef _TORTOISESHELL + //set http_proxy + CString regServeraddress_copy = CRegString(_T("Software\\TortoiseGit\\Servers\\global\\http-proxy-host"), _T("")); + CString regServerport_copy = CRegString(_T("Software\\TortoiseGit\\Servers\\global\\http-proxy-port"), _T("")); + CString regUsername_copy = CRegString(_T("Software\\TortoiseGit\\Servers\\global\\http-proxy-username"), _T("")); + CString regPassword_copy = CRegString(_T("Software\\TortoiseGit\\Servers\\global\\http-proxy-password"), _T("")); + CString regTimeout_copy = CRegString(_T("Software\\TortoiseGit\\Servers\\global\\http-proxy-timeout"), _T("")); + CString regExceptions_copy = CRegString(_T("Software\\TortoiseGit\\Servers\\global\\http-proxy-exceptions"), _T("")); + + CString http_proxy; + if(!regServeraddress_copy.IsEmpty()) + { + http_proxy=_T("http://"); + if(!regUsername_copy.IsEmpty()) + { + http_proxy += regUsername_copy; + http_proxy += _T(":")+regPassword_copy; + http_proxy += _T("@"); + } + http_proxy+=regServeraddress_copy; + if(!regServerport_copy.IsEmpty()) + { + http_proxy +=_T(":")+regServerport_copy; + } + _tputenv_s(_T("http_proxy"),http_proxy); + } + //setup ssh client CString sshclient=CRegString(_T("Software\\TortoiseGit\\SSH"));