OSDN Git Service

Fix crash when combine commit at log dialog
authorFrank Li <lznuaa@gmail.com>
Mon, 18 Jan 2010 12:20:25 +0000 (20:20 +0800)
committerFrank Li <lznuaa@gmail.com>
Mon, 18 Jan 2010 12:20:25 +0000 (20:20 +0800)
src/TortoiseProc/BranchCombox.h
src/TortoiseProc/GitLogListAction.cpp

index fd0ded8..9cca0d0 100644 (file)
@@ -131,7 +131,7 @@ protected:
                        GitRev rev;\r
                        rev.ParserFromLog(data);\r
                        tooltip.Format(_T("CommitHash:%s\nCommit by: %s  %s\n <b>%s</b> \n %s"),\r
-                               rev.m_CommitHash,\r
+                               rev.m_CommitHash.ToString(),\r
                                rev.m_AuthorName,\r
                                CAppUtils::FormatDateAndTime(rev.m_AuthorDate,DATE_LONGDATE),\r
                                rev.m_Subject,\r
index 52aa34b..d6baf29 100644 (file)
@@ -263,8 +263,8 @@ void CGitLogList::ContextMenuAction(int cmd,int FirstSelect, int LastSelect)
                case ID_COMBINE_COMMIT:\r
                {\r
                        CString head;\r
-                       CString headhash;\r
-                       CString hashFirst,hashLast;\r
+                       CGitHash headhash;\r
+                       CGitHash hashFirst,hashLast;\r
 \r
                        int headindex=GetHeadIndex();\r
                        if(headindex>=0) //incase show all branch, head is not the first commits. \r
@@ -305,7 +305,7 @@ void CGitLogList::ContextMenuAction(int cmd,int FirstSelect, int LastSelect)
                                        CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK);\r
                                        throw std::exception(CUnicodeUtils::GetUTF8(_T("Could not reset to first commit (first step) aborting...\r\n\r\n")+out));\r
                                }\r
-                               cmd.Format(_T("git.exe reset --mixed  %s"),hashLast);\r
+                               cmd.Format(_T("git.exe reset --mixed  %s"),hashLast.ToString());\r
                                if(g_Git.Run(cmd,&out,CP_UTF8))\r
                                {\r
                                        CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK);\r
@@ -388,7 +388,7 @@ void CGitLogList::ContextMenuAction(int cmd,int FirstSelect, int LastSelect)
                        catch(std::exception& e)\r
                        {\r
                                CMessageBox::Show(NULL,CUnicodeUtils::GetUnicode(CStringA(e.what())),_T("TortoiseGit: Combine error"),MB_OK|MB_ICONERROR);\r
-                               cmd.Format(_T("git.exe reset --hard  %s"),headhash);\r
+                               cmd.Format(_T("git.exe reset --hard  %s"),headhash.ToString());\r
                                out.Empty();\r
                                if(g_Git.Run(cmd,&out,CP_UTF8))\r
                                {\r