summaryrefslogtreecommitdiff
path: root/examples/cat-file.c
Commit message (Collapse)AuthorAgeFilesLines
* oid: `GIT_OID_*SZ` is now `GIT_OID_SHA1_*SIZE`Edward Thomson2022-06-141-5/+5
| | | | | In preparation for SHA256 support, `GIT_OID_RAWSZ` and `GIT_OID_HEXSZ` need to indicate that they're the size of _SHA1_ OIDs.
* examples: normalize decls and usage of options structsEtienne Samson2019-11-061-7/+8
|
* examples: create common lg2 executablePatrick Steinhardt2019-02-151-9/+1
| | | | | | | | | | | | | | | | | | 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.
* object_type: convert final internal users to new namesethomson/git_objEdward Thomson2019-01-171-4/+4
| | | | | Update some missed types that were continuing to use the old `GIT_OBJ` names.
* Rename git_threads_ to git_libgit2_Carlos Martín Nieto2014-11-081-2/+2
| | | | | | 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.
* - BUGFIX #2133 (@fourplusone) in smart_protocol.cMiha2014-02-251-1/+1
| | | | | | - added MSVC cmake definitions to disable warnings - general.c is rewritten so it is ansi-c compatible and compiles ok on microsoft windows - some MSVC reported warning fixes
* Replace copyright topmatter in example filesBen Straub2013-11-021-3/+10
|
* Fix typosBen Straub2013-11-011-1/+1
|
* A few formatting changes for roccoCarlos Martín Nieto2013-11-011-0/+8
| | | | | I'm not too happy about manually inserting < and > but those get output as html tags otherwise.
* cat-file.c example: deploy helpers, reorgBen Straub2013-10-301-76/+78
|
* Add cat-file example and increase const use in APIRussell Belfer2013-05-161-0/+229
This adds an example implementation that emulates git cat-file. It is a convenient and relatively simple example of getting data out of a repository. Implementing this also revealed that there are a number of APIs that are still not using const pointers to objects that really ought to be. The main cause of this is that `git_vector_bsearch` may need to call `git_vector_sort` before doing the search, so a const pointer to the vector is not allowed. However, for tree objects, with a little care, we can ensure that the vector of tree entries is always sorted and allow lookups to take a const pointer. Also, the missing const in commit objects just looks like an oversight.