OSDN Git Service

Build is okay
[tortoisegit/TortoiseGitJp.git] / src / Git / Git.h
index 8afb2fa..425f5e4 100644 (file)
@@ -3,6 +3,7 @@
 #include "GitRev.h"\r
 #include "GitStatus.h"\r
 #include "GitAdminDir.h"\r
+#include "gitdll.h"\r
 \r
 class CGitCall\r
 {\r
@@ -30,7 +31,27 @@ class CGit
 {\r
 private:\r
        GitAdminDir m_GitDir;\r
+protected:\r
+       bool m_IsGitDllInited;\r
+       GIT_DIFF m_GitDiff;\r
 public:\r
+       void CheckAndInitDll()\r
+       { \r
+               if(!m_IsGitDllInited) \r
+               {\r
+                       git_init();\r
+                       m_IsGitDllInited=true;\r
+               } \r
+       }\r
+\r
+       GIT_DIFF GetGitDiff()\r
+       {\r
+               if(m_GitDiff)\r
+                       return m_GitDiff;\r
+               else\r
+                       git_open_diff(&m_GitDiff,"-C -M");\r
+       }\r
+\r
        static BOOL CheckMsysGitDir();\r
        static CString ms_LastMsysGitDir;       // the last msysgitdir added to the path, blank if none\r
        static int m_LogEncode;\r
@@ -132,6 +153,7 @@ public:
        static CString StripRefName(CString refName);\r
 \r
        int GetCommitDiffList(CString &rev1,CString &rev2,CTGitPathList &outpathlist);\r
+\r
        \r
 };\r
 extern void GetTempPath(CString &path);\r