1 // gitdlltest.cpp : Defines the entry point for the console application.
\r
7 int output(int ret, char * name)
\r
10 printf("Fail \t%s\r\n",name);
\r
12 printf("Success\t%s\r\n",name);
\r
15 int _tmain(int argc, _TCHAR* argv[])
\r
21 memset(&hash,0,sizeof(GIT_HASH));
\r
24 output(ret,"git_init");
\r
25 ret=git_get_sha1("master",hash);
\r
26 output(ret,"git_get_sha1");
\r
27 ret=git_get_sha1("head",hash);
\r
28 output(ret,"git_get_sha1");
\r
29 ret=git_get_commit_from_hash(&commit, hash);
\r
30 output(ret,"git_get_commit_from_hash");
\r
33 ret=git_open_log(&handle,"--stat -c -- \"build.txt\"");
\r
34 output(ret,"git_open_log");
\r
35 ret=git_get_log_firstcommit(handle);
\r
36 output(ret,"git_get_log_firstcommit");
\r
38 while( git_get_log_nextcommit(handle,&commit) == 0)
\r
40 //printf("%s\r\n",commit.m_Subject);
\r
42 git_free_commit(&commit);
\r
44 printf("commit number %d\r\n",count);
\r
45 ret=git_close_log(handle);
\r
46 output(ret,"git_close_log");
\r