#include "GitConfig.h"\r
#include <map>\r
#include "UnicodeUtils.h"\r
+#include "gitdll.h"\r
\r
int CGit::m_LogEncode=CP_UTF8;\r
\r
+\r
static LPTSTR nextpath(LPCTSTR src, LPTSTR dst, UINT maxlen)\r
{\r
LPCTSTR orgsrc;\r
{\r
GetCurrentDirectory(MAX_DIRBUFFER,m_CurrentDir.GetBuffer(MAX_DIRBUFFER));\r
m_CurrentDir.ReleaseBuffer();\r
-\r
+ m_IsGitDllInited = false;\r
+ m_GitDiff=0;\r
CheckMsysGitDir();\r
}\r
\r
CGit::~CGit(void)\r
{\r
+ if(this->m_GitDiff)\r
+ {\r
+ git_close_diff(m_GitDiff);\r
+ m_GitDiff=0;\r
+ }\r
}\r
\r
static char g_Buffer[4096];\r
return GetLog(&gitCall,hash,path,count,mask,from,to);\r
}\r
\r
-//int CGit::GetLog(CGitCall* pgitCall, CString &hash, CTGitPath *path ,int count,int mask)\r
-int CGit::GetLog(CGitCall* pgitCall, CString &hash, CTGitPath *path, int count, int mask,CString *from,CString *to)\r
+CString CGit::GetLogCmd( CString &hash, CTGitPath *path, int count, int mask,CString *from,CString *to,bool paramonly)\r
{\r
-\r
CString cmd;\r
CString log;\r
CString num;\r
}\r
param+=hash;\r
\r
- cmd.Format(_T("git.exe log %s -z --topo-order %s --parents --pretty=format:\""),\r
+ if(paramonly)\r
+ cmd.Format(_T("%s -z --topo-order %s --parents "),\r
+ num,param);\r
+ else\r
+ cmd.Format(_T("git.exe log %s -z --topo-order %s --parents --pretty=format:\""),\r
num,param);\r
\r
BuildOutputFormat(log,!(mask&CGit::LOG_INFO_ONLY_HASH));\r
\r
- cmd += log;\r
- cmd += CString(_T("\" "))+hash+file;\r
+ if(paramonly)\r
+ {\r
+ cmd += hash+file;\r
+ }else\r
+ {\r
+ cmd += log;\r
+ cmd += CString(_T("\" "))+hash+file;\r
+ }\r
\r
- pgitCall->SetCmd(cmd);\r
+ return cmd;\r
+}\r
+//int CGit::GetLog(CGitCall* pgitCall, CString &hash, CTGitPath *path ,int count,int mask)\r
+int CGit::GetLog(CGitCall* pgitCall, CString &hash, CTGitPath *path, int count, int mask,CString *from,CString *to)\r
+{\r
+ pgitCall->SetCmd( GetLogCmd(hash,path,count,mask,from,to) );\r
\r
return Run(pgitCall);\r
// return Run(cmd,&logOut);\r
}\r
\r
-#if 0\r
-int CGit::GetShortLog(CString &logOut,CTGitPath * path, int count)\r
-{\r
- CString cmd;\r
- CString log;\r
- int n;\r
- if(count<0)\r
- n=100;\r
- else\r
- n=count;\r
- cmd.Format(_T("git.exe log --left-right --boundary --topo-order -n%d --pretty=format:\""),n);\r
- BuildOutputFormat(log,false);\r
- cmd += log+_T("\"");\r
- if (path)\r
- cmd+= _T(" -- \"")+path->GetGitPathString()+_T("\"");\r
- //cmd += CString(_T("\" HEAD~40..HEAD"));\r
- return Run(cmd,&logOut);\r
-}\r
-#endif\r
-\r
#define BUFSIZE 512\r
void GetTempPath(CString &path)\r
{\r
CString sSubPath = pszSubPath;\r
sSubPath.Replace(_T('\\'), _T('/'));\r
\r
- cmd.Format(_T("igit.exe \"%s\" status %s \"%s\""), sProjectPath, sMode, sSubPath);\r
+ cmd.Format(_T("tgit.exe statusex \"%s\" status %s \"%s\""), sProjectPath, sMode, sSubPath);\r
}\r
else\r
{\r
- cmd.Format(_T("igit.exe \"%s\" status %s"), sProjectPath, sMode);\r
+ cmd.Format(_T("tgit.exe statusex \"%s\" status %s"), sProjectPath, sMode);\r
}\r
\r
//OutputDebugStringA("---");OutputDebugStringW(cmd);OutputDebugStringA("\r\n");\r