OSDN Git Service

Fix Issue 77: "Show differencess" against a deleted file will cause TortoiseMerge...
[tortoisegit/TortoiseGitJp.git] / src / Git / GitStatusListCtrl.cpp
index 7260bc6..e538bac 100644 (file)
@@ -4000,13 +4000,16 @@ void CGitStatusListCtrl::StartDiff(int fileindex)
 \r
        if(this->m_CurrentVersion.IsEmpty() || m_CurrentVersion== GIT_REV_ZERO)\r
        {\r
-               if(!g_Git.IsInitRepos())\r
+               if( g_Git.IsInitRepos())\r
+                       CGitDiff::DiffNull((CTGitPath*)GetItemData(fileindex),\r
+                               CString(GIT_REV_ZERO));                 \r
+               else if( file1.m_Action&CTGitPath::LOGACTIONS_DELETED )\r
+                       CGitDiff::DiffNull((CTGitPath*)GetItemData(fileindex),\r
+                                       GitRev::GetHead(),false);                               \r
+               else\r
                        CGitDiff::Diff(&file1,&file2,\r
                                CString(GIT_REV_ZERO),\r
                                        GitRev::GetHead());\r
-               else\r
-                       CGitDiff::DiffNull((CTGitPath*)GetItemData(fileindex),\r
-                               CString(GIT_REV_ZERO));\r
        }else\r
        {\r
                CGitDiff::Diff(&file1,&file2,\r