OSDN Git Service

Share resource file between TortoiseGitBlame and TortoiseProc
[tortoisegit/TortoiseGitJp.git] / src / Git / GitRev.cpp
index 0394e26..bc9aee3 100644 (file)
@@ -60,7 +60,7 @@ int GitRev::ParserFromLog(CString &log)
        CString key;\r
        CString text;\r
        CString filelist;\r
-       TCHAR mode;\r
+       TCHAR mode=0;\r
        CTGitPath  path;\r
        this->m_Files.Clear();\r
     m_Action=0;\r
@@ -103,7 +103,10 @@ int GitRev::ParserFromLog(CString &log)
                                break;\r
                        case LOG_REV_COMMIT_HASH:\r
                                this->m_CommitHash = text.Right(40);\r
-                               this->m_Mark=text[0];\r
+                               if(text.GetLength()>40)\r
+                               {\r
+                                       this->m_Mark=text[0];\r
+                               }\r
                                break;\r
                        case LOG_REV_COMMIT_PARENT:\r
                                while(text.GetLength()>0)\r
@@ -155,11 +158,16 @@ int GitRev::SafeFetchFullInfo(CGit *git)
        {\r
                //GitRev rev;\r
                CString onelog;\r
-               git->GetLog(onelog,m_CommitHash,1);\r
+               TCHAR oldmark=this->m_Mark;\r
+       \r
+               git->GetLog(onelog,m_CommitHash,NULL,1);\r
                CString oldhash=m_CommitHash;\r
                ParserFromLog(onelog);\r
                \r
                //ASSERT(oldhash==m_CommitHash);\r
+               if(oldmark!=0)\r
+                       this->m_Mark=oldmark;  //parser full log will cause old mark overwrited. \r
+                                                              //So we need keep old bound mark.\r
 \r
                InterlockedExchange(&m_IsUpdateing,FALSE);\r
                InterlockedExchange(&m_IsFull,TRUE);\r