From 5ea731d987635f38101165fa49c3305a4c59a3c1 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Fri, 25 Apr 2014 15:48:34 +0200 Subject: [PATCH] No need to retrieve whole commit Signed-off-by: Sven Strickroth --- src/Git/GitStatusListCtrl.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/Git/GitStatusListCtrl.cpp b/src/Git/GitStatusListCtrl.cpp index 57d65b645..025d3b42d 100644 --- a/src/Git/GitStatusListCtrl.cpp +++ b/src/Git/GitStatusListCtrl.cpp @@ -2720,20 +2720,11 @@ void CGitStatusListCtrl::StartDiff(int fileindex) } else { - GitRev rev; + CGitHash hash; CString fromwhere = m_CurrentVersion+_T("~1"); if(m_amend) fromwhere = m_CurrentVersion+_T("~2"); - bool revfail = false; - try - { - revfail = !!rev.GetCommit(fromwhere); - } - catch (const char *msg) - { - revfail = true; - CMessageBox::Show(NULL, _T("Could not get commit ") + fromwhere + _T("\nlibgit reports:\n") + CString(msg), _T("TortoiseGit"), MB_ICONERROR); - } + bool revfail = !!g_Git.GetHash(hash, fromwhere); if (revfail || (file1.m_Action & file1.LOGACTIONS_ADDED)) { CGitDiff::DiffNull(&file1,m_CurrentVersion,true); -- 2.11.4.GIT