Created
January 25, 2015 18:46
-
-
Save minshallj/8e8eee00e03f5f5c1da2 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
default: all | |
CFLAGS += -I/home/jacob/dev/libgit2/include | |
LDFLAGS += -L/home/jacob/dev/libgit2/build | |
LIBRARIES += -lgit2 | |
OBJECTS = sample.o | |
all: $(OBJECTS) | |
gcc $(CFLAGS) $(LDFLAGS) -o out.out $(OBJECTS) $(LIBRARIES) |
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> | |
int main() | |
{ | |
git_repository *repo = NULL; | |
//const char *url = "file:///tmp/test-repo"; | |
const char *url = "file:///home/jacob/dev/libgit2"; | |
const char *path = "/tmp/test-dest"; | |
const git_error *e; | |
int error; | |
git_libgit2_init(); | |
printf("before clone\n"); | |
error = git_clone(&repo, url, path, NULL); | |
printf("after clone\n"); | |
if (error < 0) { | |
e = giterr_last(); | |
printf("Error %d/%d: %s\n", error, e->klass, e->message); | |
exit(error); | |
} | |
git_libgit2_shutdown(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment