8 Commits

Author SHA1 Message Date
Edward Thomson
9aa5faa38b indexer: move oid_type into the opts structure
Object ID type should be an option within the options structure; move it
there.
2024-12-18 16:27:46 +00:00
Edward Thomson
fe2ee3a018 object: lookup sha256 objects
This is much of the plumbing for the object database to support SHA256,
and for objects to be able to parse SHA256 versions of themselves.
2023-02-12 22:02:00 +00:00
Edward Thomson
d2458af7b7 indexer: use a byte array for checksum
The index's checksum is not an object ID, so we should not use the
`git_oid` type.  Use a byte array for checksum calculation and storage.

Deprecate the `git_indexer_hash` function.  Callers should use the new
`git_indexer_name` function which provides a unique packfile name.
2022-01-27 20:15:09 -05:00
Scott Furry
73a186f28a Adjust printf specifiers in examples code
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.
2019-08-01 12:52:12 -06:00
Patrick Steinhardt
960d2a070f examples: consolidate includes into "common.h"
Consolidate all standard includes and defines into "common.h". This lets
us avoid having to handle platform-specific things in multiple places.
2019-07-05 14:30:48 +02:00
Edward Thomson
b6b2d9d78a examples: ssize_t is signed, not unsigned 2019-06-25 15:22:46 +01:00
Edward Thomson
a1ef995dc0 indexer: use git_indexer_progress throughout
Update internal usage of `git_transfer_progress` to
`git_indexer_progreses`.
2019-02-22 11:25:14 +00: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