OSDN Git Service

Improvements to Diff of modified version against head
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / Commands / DiffCommand.cpp
index db596f9..dd081f8 100644 (file)
@@ -20,7 +20,7 @@
 #include "DiffCommand.h"\r
 #include "PathUtils.h"\r
 #include "AppUtils.h"\r
-//#include "ChangedDlg.h"\r
+#include "ChangedDlg.h"\r
 #include "GitDiff.h"\r
 #include "GitStatus.h"\r
 \r
@@ -29,20 +29,21 @@ bool DiffCommand::Execute()
        bool bRet = false;\r
        CString path2 = CPathUtils::GetLongPathname(parser.GetVal(_T("path2")));\r
        bool bAlternativeTool = !!parser.HasKey(_T("alternative"));\r
-       bool bBlame = !!parser.HasKey(_T("blame"));\r
+//     bool bBlame = !!parser.HasKey(_T("blame"));\r
        if (path2.IsEmpty())\r
        {\r
                if (cmdLinePath.IsDirectory())\r
                {\r
-                       //CChangedDlg dlg;\r
-                       //dlg.m_pathList = CTSVNPathList(cmdLinePath);\r
-                       //dlg.DoModal();\r
-                       //bRet = true;\r
+                       CChangedDlg dlg;\r
+                       dlg.m_pathList = CTGitPathList(cmdLinePath);\r
+                       dlg.DoModal();\r
+                       bRet = true;\r
                }\r
                else\r
                {\r
                        CGitDiff diff;\r
                        //diff.SetAlternativeTool(bAlternativeTool);\r
+#if 0\r
                        if ( parser.HasKey(_T("startrev")) && parser.HasKey(_T("endrev")) )\r
                        {\r
                                //SVNRev StartRevision = SVNRev(parser.GetLongVal(_T("startrev")));\r
@@ -50,15 +51,16 @@ bool DiffCommand::Execute()
                                //bRet = diff.ShowCompare(cmdLinePath, StartRevision, cmdLinePath, EndRevision, SVNRev(), false, bBlame);\r
                        }\r
                        else\r
+#endif\r
                        {\r
-                               //svn_revnum_t baseRev = 0;\r
-                               bRet = diff.Diff(&cmdLinePath,git_revnum_t(_T("HEAD")),git_revnum_t(GIT_REV_ZERO));\r
+                               //git_revnum_t baseRev = 0;\r
+                               bRet = diff.Diff(&cmdLinePath,&cmdLinePath,git_revnum_t(GIT_REV_ZERO),git_revnum_t(_T("HEAD")));\r
                        }\r
                }\r
        } \r
        else\r
                bRet = CAppUtils::StartExtDiff(\r
-                       path2, cmdLinePath.GetWinPathString(), CString(), CString(),\r
+                       path2, orgCmdLinePath.GetWinPathString(), CString(), CString(),\r
                        CAppUtils::DiffFlags().AlternativeTool(bAlternativeTool));\r
        return bRet;\r
 }
\ No newline at end of file