diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2015-02-05 09:18:47 -0500 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2015-02-05 09:18:47 -0500 |
commit | 3dc92940c8606b55c1ed35552ab6fa3b113dd2bd (patch) | |
tree | 8077ebf03ba2e29fbe58d0159ff94bc51bdc391f | |
parent | 3983935b0f7d5ece65bb8c6532af2f7ed27a197a (diff) | |
parent | 2107dac34624421015c3a633975bde0ff797ba53 (diff) | |
download | libgit2-3dc92940c8606b55c1ed35552ab6fa3b113dd2bd.tar.gz |
Merge pull request #2875 from JIghtuse/master
for-each-ref example: initialize libgit2 in main
-rw-r--r-- | examples/for-each-ref.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/for-each-ref.c b/examples/for-each-ref.c index d6846bb0d..a8ceaaff9 100644 --- a/examples/for-each-ref.c +++ b/examples/for-each-ref.c @@ -34,6 +34,7 @@ static int show_ref(git_reference *ref, void *data) int main(int argc, char **argv) { git_repository *repo; + git_libgit2_init(); if (argc != 1 || argv[1] /* silence -Wunused-parameter */) fatal("Sorry, no for-each-ref options supported yet", NULL); @@ -42,5 +43,7 @@ int main(int argc, char **argv) "Could not open repository", NULL); check_lg2(git_reference_foreach(repo, show_ref, repo), "Could not iterate over references", NULL); + + git_libgit2_shutdown(); return 0; } |