Commit Graph

10 Commits

Author SHA1 Message Date
Etienne Samson
313908f9f5 examples: normalize decls and usage of options structs 2019-11-06 11:17:56 +01:00
Scott Furry
2ba7dbbe35 Resolve static check warnings in example code
Using cppcheck on libgit2 sources indicated two warnings in
example code.

merge.c was reported as having a memory leak. Fix applied
was to `free()` memory pointed to by `parents`.

init.c was reported as having a null pointer dereference
on variable arg. Function 'usage' was being called with
a null variable. Changed supplied parameter to empty string.
2019-06-27 04:59:28 -06:00
Patrick Steinhardt
ead10785dc examples: create common lg2 executable
Inside of our networking example code, we have a git2 executable
that acts as an entry point to all the different network
examples. As such, it is kind of the same like the normal git(1)
executable in that it simply arbitrates to the respective
subcommands.

Let's extend this approach and merge all examples into a single
standalone lg2 executable. Instead of building an executable
for all the existing examples we have, we now bundle them all
inside of the lg2 one and let them be callable via subcommands.

In the process, we can get rid of duplicated library
initialization, deinitialization and repository discovery code.
Instead of having each subcommand handle these on its own, we
simply do it inside of the single main function now.
2019-02-15 12:06:54 +01:00
Carlos Martín Nieto
799e22ea0c Rename git_threads_ to git_libgit2_
This describes their purpose better, as we now initialize ssl and some
other global stuff in there. Calling the init function is not something
which has been optional for a while now.
2014-11-08 23:46:39 +01:00
Ben Straub
6cb831bd56 Replace copyright topmatter in example files 2013-11-02 05:33:26 -07:00
Ben Straub
85c6730ce8 Format comments for use with docco 2013-10-31 14:35:32 -07:00
Ben Straub
7cc3c9bf00 init.c example: deploy more helpers 2013-10-30 06:09:08 -07:00
Ben Straub
a8422f9202 init example: deploy helpers, reorg 2013-10-30 05:38:12 -07:00
Russell Belfer
0ea41445f4 Improve isolation of new test from user environs 2013-08-16 15:04:15 -07:00
Russell Belfer
944c1589c2 Add example like "git init" 2013-08-16 15:04:15 -07:00