5 #include "GitAdminDir.h"
11 CGitCall(CString cmd
):m_Cmd(cmd
){}
13 CString
GetCmd()const{return m_Cmd
;}
14 void SetCmd(CString cmd
){m_Cmd
=cmd
;}
16 //This function is called when command output data is available.
17 //When this function returns 'true' the git command should be aborted.
18 //This behavior is not implemented yet.
19 virtual bool OnOutputData(const BYTE
* data
, size_t size
)=0;
20 virtual void OnEnd(){}
34 static BOOL
CheckMsysGitDir();
35 static CString ms_LastMsysGitDir
; // the last msysgitdir added to the path, blank if none
37 // static CString m_MsysGitPath;
41 int Run(CString cmd
, CString
* output
,int code
);
42 int Run(CString cmd
, BYTE_VECTOR
*byte_array
);
43 int Run(CGitCall
* pcall
);
45 int RunAsync(CString cmd
,PROCESS_INFORMATION
*pi
, HANDLE
* hRead
, CString
*StdioFile
=NULL
);
46 int RunLogFile(CString cmd
, CString
&filename
);
47 CString
GetUserName(void);
48 CString
GetUserEmail(void);
49 CString
GetCurrentBranch(void);
51 bool SetCurrentDir(CString path
)
53 return m_GitDir
.HasAdminDir(path
,&m_CurrentDir
);
61 BRANCH_ALL
=BRANCH_LOCAL
|BRANCH_REMOTE
,
67 LOG_INFO_FILESTATE
=0x2,
69 LOG_INFO_FULLHISTORY
=0x8,
70 LOG_INFO_BOUNDARY
=0x10,
71 LOG_INFO_ALL_BRANCH
=0x20,
72 LOG_INFO_ONLY_HASH
=0x40,
73 LOG_INFO_DETECT_RENAME
=0x80,
74 LOG_INFO_DETECT_COPYRENAME
=0x100,
75 LOG_INFO_FIRST_PARENT
= 0x200,
76 LOG_INFO_NO_MERGE
= 0x400,
77 LOG_INFO_FOLLOW
= 0x800
80 int GetRemoteList(STRING_VECTOR
&list
);
81 int GetBranchList(STRING_VECTOR
&list
, int *Current
,BRANCH_TYPE type
=BRANCH_LOCAL
);
82 int GetTagList(STRING_VECTOR
&list
);
83 int GetMapHashToFriendName(MAP_HASH_NAME
&map
);
85 //hash is empty means all. -1 means all
87 int GetLog(CGitCall
* pgitCall
, CString
&hash
, CTGitPath
*path
= NULL
,int count
=-1,int InfoMask
=LOG_INFO_STAT
|LOG_INFO_FILESTATE
|LOG_INFO_BOUNDARY
|LOG_INFO_DETECT_COPYRENAME
);
88 int GetLog(BYTE_VECTOR
& logOut
,CString
&hash
, CTGitPath
*path
= NULL
,int count
=-1,int InfoMask
=LOG_INFO_STAT
|LOG_INFO_FILESTATE
|LOG_INFO_BOUNDARY
|LOG_INFO_DETECT_COPYRENAME
);
90 BOOL
EnumFiles(const char *pszProjectPath
, const char *pszSubPath
, unsigned int nFlags
, WGENUMFILECB
*pEnumCb
, void *pUserData
);
92 git_revnum_t
GetHash(CString
&friendname
);
94 int BuildOutputFormat(CString
&format
,bool IsFull
=TRUE
);
95 //int GetShortLog(CString &log,CTGitPath * path=NULL, int count =-1);
96 static void StringAppend(CString
*str
,BYTE
*p
,int code
=CP_UTF8
,int length
=-1);
99 static BOOL
IsVista();
102 extern void GetTempPath(CString
&path
);
103 extern CString
GetTempFile();
108 extern LPBYTE
wgGetRevisionID_safe(const char *pszProjectPath
, const char *pszName
);
109 extern BOOL
wgEnumFiles_safe(const char *pszProjectPath
, const char *pszSubPath
, unsigned int nFlags
, WGENUMFILECB
*pEnumCb
, void *pUserData
);