Git DLL get commit information basic work.
[TortoiseGit.git] / ext / gitdlltest / gitdlltest.cpp
blob7298439773b7f23acb11d4cc3789836bbc94ff4c
1 // gitdlltest.cpp : Defines the entry point for the console application.
2 //
4 #include "stdafx.h"
5 #include "gitdll.h"
7 int output(int ret, char * name)
9 if(ret)
10 printf("Fail \t%s\r\n",name);
11 else
12 printf("Success\t%s\r\n",name);
13 return 0;
15 int _tmain(int argc, _TCHAR* argv[])
17 GIT_HASH hash;
18 GIT_COMMIT commit;
19 char *buf;
20 int size;
21 memset(&hash,0,sizeof(GIT_HASH));
22 int ret;
23 ret=git_init();
24 output(ret,"git_init");
25 ret=git_get_sha1("master",hash);
26 output(ret,"git_get_sha1");
27 ret=git_get_sha1("head",hash);
28 output(ret,"git_get_sha1");
29 ret=git_get_commit_from_hash(&commit, hash);
30 output(ret,"git_get_commit_from_hash");
32 return ret;