m_bIsDirectory = bIsDirectory;\r
}\r
\r
+void CTGitPath::SetFromGit(const TCHAR* pPath, bool bIsDirectory)\r
+{\r
+ Reset();\r
+ if (pPath)\r
+ {\r
+ m_sFwdslashPath = pPath;\r
+ SanitizeRootPath(m_sFwdslashPath, true);\r
+ }\r
+ m_bDirectoryKnown = true;\r
+ m_bIsDirectory = bIsDirectory;\r
+}\r
+\r
void CTGitPath::SetFromGit(const CString& sPath,CString *oldpath)\r
{\r
Reset();\r
m_bExistsKnown = true;\r
}\r
\r
+CTGitPath CTGitPath::GetSubPath(CTGitPath &root)\r
+{\r
+ CTGitPath path;\r
+ \r
+ if(GetWinPathString().Left(root.GetWinPathString().GetLength()) == root.GetWinPathString())\r
+ {\r
+ CString str=GetWinPathString();\r
+ path.SetFromWin(str.Right(str.GetLength()-root.GetWinPathString().GetLength()-1));\r
+ }\r
+ return path;\r
+}\r
\r
void CTGitPath::EnsureBackslashPathSet() const\r
{\r
CString filename=GetFilename();\r
dot = filename.ReverseFind(_T('.'));\r
if(dot>0)\r
- return filename.Left(dot-1);\r
+ return filename.Left(dot);\r
else\r
return filename;\r
}\r
return m_bHasAdminDir;\r
}\r
\r
+bool CTGitPath::HasSubmodules() const\r
+{\r
+ return !g_GitAdminDir.GetSuperProjectRoot(GetWinPathString()).IsEmpty();\r
+}\r
+\r
bool CTGitPath::HasAdminDir(CString *ProjectTopDir) const\r
{\r
if (m_bHasAdminDirKnown)\r
one.Empty();\r
path.Reset();\r
\r
- g_Git.StringAppend(&one,&out[pos],CP_OEMCP);\r
+ g_Git.StringAppend(&one,&out[pos],CP_ACP);\r
int tabstart=0;\r
path.m_Action=path.ParserAction(out[pos]);\r
one.Tokenize(_T("\t"),tabstart); \r
while( pos>=0 && pos<out.size())\r
{\r
one.Empty();\r
- g_Git.StringAppend(&one,&out[pos],CP_OEMCP);\r
+ g_Git.StringAppend(&one,&out[pos],CP_ACP);\r
if(!one.IsEmpty())\r
{\r
//SetFromGit will clear all status\r
\r
if(log[pos]==':')\r
{\r
+ bool merged=false;\r
+ if(log[pos+1] ==':')\r
+ {\r
+ merged=true;\r
+ }\r
int end=log.find(0,pos);\r
int actionstart=-1;\r
int numfile=1;\r
CString pathname2;\r
\r
if( file1>=0 )\r
- g_Git.StringAppend(&pathname1,&log[file1],CP_OEMCP);\r
+ g_Git.StringAppend(&pathname1,&log[file1],CP_ACP);\r
if( file2>=0 )\r
- g_Git.StringAppend(&pathname2,&log[file2],CP_OEMCP);\r
+ g_Git.StringAppend(&pathname2,&log[file2],CP_ACP);\r
\r
CTGitPath *GitPath=LookForGitPath(pathname1);\r
\r
if(GitPath)\r
{\r
- this->m_Action|=GitPath->ParserAction( log[actionstart] ); \r
- \r
+ GitPath->ParserAction( log[actionstart] ); \r
+ \r
+ if(merged)\r
+ {\r
+ GitPath->m_Action |= CTGitPath::LOGACTIONS_MERGED;\r
+ GitPath->m_Action &= ~CTGitPath::LOGACTIONS_FORWORD;\r
+ }\r
+ m_Action |=GitPath->m_Action;\r
+\r
}else\r
{ \r
int ac=path.ParserAction(log[actionstart] );\r
+ ac |= merged?CTGitPath::LOGACTIONS_MERGED:0; \r
\r
path.SetFromGit(pathname1,&pathname2);\r
path.m_Action=ac;\r
//action must be set after setfromgit. SetFromGit will clear all status. \r
this->m_Action|=ac;\r
+ \r
AddPath(path);\r
\r
}\r
if(log[pos] == 0) //rename\r
{\r
pos++;\r
- g_Git.StringAppend(&file2,&log[pos],CP_OEMCP);\r
+ g_Git.StringAppend(&file2,&log[pos],CP_ACP);\r
int sec=log.find(0,pos);\r
if(sec>=0)\r
{\r
sec++;\r
- g_Git.StringAppend(&file1,&log[sec],CP_OEMCP);\r
+ g_Git.StringAppend(&file1,&log[sec],CP_ACP);\r
}\r
pos=sec;\r
\r
}else\r
{\r
- g_Git.StringAppend(&file1,&log[pos],CP_OEMCP);\r
+ g_Git.StringAppend(&file1,&log[pos],CP_ACP);\r
}\r
path.SetFromGit(file1,&file2);\r
\r
//path.SetFromGit(pathname);\r
path.m_StatAdd=StatAdd;\r
path.m_StatDel=StatDel;\r
+ path.m_Action |= CTGitPath::LOGACTIONS_FORWORD;\r
AddPath(path);\r
}\r
\r
}\r
CString CTGitPath::GetActionName(int action)\r
{\r
+ if(action & CTGitPath::LOGACTIONS_UNMERGED)\r
+ return _T("Conflict");\r
if(action & CTGitPath::LOGACTIONS_ADDED)\r
return _T("Added");\r
if(action & CTGitPath::LOGACTIONS_DELETED)\r
return _T("Deleted");\r
- if(action & CTGitPath::LOGACTIONS_UNMERGED)\r
- return _T("Conflict");\r
+ if(action & CTGitPath::LOGACTIONS_MERGED )\r
+ return _T("Merged");\r
+\r
if(action & CTGitPath::LOGACTIONS_MODIFIED)\r
return _T("Modified");\r
if(action & CTGitPath::LOGACTIONS_REPLACED)\r
return _T("Rename");\r
if(action & CTGitPath::LOGACTIONS_COPY)\r
return _T("Copy");\r
+\r
+ if(action & CTGitPath::LOGACTIONS_FORWORD )\r
+ return _T("Forward");\r
+\r
if(action & CTGitPath::LOGACTIONS_REBASE_EDIT)\r
return _T("Edit");\r
if(action & CTGitPath::LOGACTIONS_REBASE_SQUASH)\r
{\r
return m_Action;\r
}\r
+\r