summaryrefslogtreecommitdiff
path: root/examples/clone.c
Commit message (Collapse)AuthorAgeFilesLines
* Adjust printf specifiers in examples codeScott Furry2019-08-011-2/+2
| | | | | | | Static analysis of example code found multiple findings of `printf` usage where filling value is members of git_indexer_progress object. Specifier used was for signed int but git_indexer_progress members are typed as unsigned ints. `printf` specifiers were altered to match type.
* examples: avoid conversion warnings when calculating progressPatrick Steinhardt2019-07-051-3/+3
| | | | | | | | | | When computing the progress, we perform some arithmetics that are implicitly converting from `size_t` to `int`. In one case we're calclulating a percentage, so we know that it should always be in the range of [0,100] and thus we're fine. In the other case we convert from bytes to kilobytes -- this should be stored in a `size_t` to avoid loss of precision, even though it probably won't matter due to limited download rates.
* indexer: use git_indexer_progress throughoutEdward Thomson2019-02-221-2/+2
| | | | | Update internal usage of `git_transfer_progress` to `git_indexer_progreses`.
* examples: create common lg2 executablePatrick Steinhardt2019-02-151-0/+104
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.