progit / progit2

Pro Git 2nd Edition
Other
5.69k stars 1.88k forks source link

Libgit2 example more concrete #1897

Open pauljoohyunkim opened 10 months ago

pauljoohyunkim commented 10 months ago

Changes

Context

For people using libgit2 in C, it may be more useful to have an actual program that one can compile rather than just the code snippets. I think it is neither that many more lines than before, nor any difficult line, so it shouldn't confuse anyone.

Also without the initialization by calling git_libgit2_init(), the error variable holds GIT_ERROR (generic error), so I decided to include it (and subsequently, git_libgit2_shutdown() for freeing the global state.)