I don't get how it was working without git_libgit2_init() call. I run it
and libgit2 throws assertion somewhere in its internals. Now it works.
Updated commit with shutdown at the end.
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);
"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;
}