Created
March 7, 2011 15:33
-
-
Save mrosset/858643 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <git2.h> | |
| #include <stdio.h> | |
| #define BARE 1 | |
| #define NOTBARE 0 | |
| int test_repo(const char *path, unsigned type); | |
| int main() | |
| { | |
| const char *tmpdir = "./tmp\0"; | |
| printf("beginning test\n"); | |
| printf("bare\t\t"); | |
| test_repo(tmpdir, BARE); | |
| printf("not bare\t"); | |
| test_repo(tmpdir, NOTBARE); | |
| printf("done.\n"); | |
| return 0; | |
| } | |
| int test_repo(const char *path, unsigned type) | |
| { | |
| git_repository *repo; | |
| int error = GIT_SUCCESS; | |
| error = git_repository_init(&repo,path,type); | |
| if (error != 0) { | |
| printf("ERROR: init %s code %i\n",path,error); | |
| return error; | |
| }; | |
| error = git_repository_open(&repo, path); | |
| if (error != 0) { | |
| printf("ERROR: opening %s code %i\n",path,error); | |
| return error; | |
| }; | |
| printf(" pass\n"); | |
| git_repository_free(repo); | |
| return error; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
warning: passing argument 1 of 'git_repository_open' from incompatible pointer type