}\r
//Must use sperate function to convert ANSI str to union code string\r
//Becuase A2W use stack as internal convert buffer. \r
-void CGit::StringAppend(CString *str,BYTE *p,int code)\r
+void CGit::StringAppend(CString *str,BYTE *p,int code,int length)\r
{\r
//USES_CONVERSION;\r
//str->Append(A2W_CP((LPCSTR)p,code));\r
WCHAR * buf;\r
- int len = strlen((const char*)p);\r
+\r
+ int len ;\r
+ if(length<0)\r
+ len= strlen((const char*)p);\r
+ else\r
+ len=length;\r
//if (len==0)\r
// return ;\r
//buf = new WCHAR[len*4 + 1];\r
buf = str->GetBuffer(len*4+1+str->GetLength())+str->GetLength();\r
SecureZeroMemory(buf, (len*4 + 1)*sizeof(WCHAR));\r
- MultiByteToWideChar(code, 0, (LPCSTR)p, -1, buf, len*4);\r
+ MultiByteToWideChar(code, 0, (LPCSTR)p, len, buf, len*4);\r
str->ReleaseBuffer();\r
//str->Append(buf);\r
//delete buf;\r
if(mask& CGit::LOG_INFO_DETECT_RENAME )\r
param += _T(" -M ");\r
\r
+ if(mask& CGit::LOG_INFO_FIRST_PARENT )\r
+ param += _T(" --first-parent ");\r
+ \r
+ if(mask& CGit::LOG_INFO_NO_MERGE )\r
+ param += _T(" --no-merges ");\r
+\r
+ if(mask& CGit::LOG_INFO_FOLLOW)\r
+ param += _T(" --follow ");\r
+\r
param+=hash;\r
\r
- cmd.Format(_T("git.exe log %s -z --topo-order --parents %s --pretty=format:\""),\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