libgit2/tests/object
Carlos Martín Nieto 0a5c602889 blob: introduce creating a blob by writing into a stream
The pair of `git_blob_create_frombuffer()` and
`git_blob_create_frombuffer_commit()` is meant to replace
`git_blob_create_fromchunks()` by providing a way for a user to write a
new blob when they want filtering or they do not know the size.

This approach allows the caller to retain control over when to add data
to this buffer and a more natural fit into higher-level language's own
stream abstractions instead of having to handle IO wait in the callback.

The in-memory buffer size of 2MB is chosen somewhat arbitrarily to be a
round multiple of usual page sizes and a value where most blobs seem
likely to be either going to be way below or way over that size. It's
also a round number of pages.

This implementation re-uses the helper we have from `_fromchunks()` so
we end up writing everything to disk, but hopefully more efficiently
than with a default filebuf. A later optimisation can be to avoid
writing the in-memory contents to disk, with some extra complexity.
2016-03-22 19:34:08 +01:00
..
blob blob: introduce creating a blob by writing into a stream 2016-03-22 19:34:08 +01:00
commit message: don't assume the comment char 2014-05-18 10:06:49 +02:00
raw Factor 40 and 41 constants from source. 2014-09-16 13:07:04 +02:00
tag Rename tests-clar to tests 2013-11-14 14:05:52 -08:00
tree tree: re-use the id and filename in the odb object 2016-03-20 11:00:12 +01:00
cache.c Win32: Fix object::cache::threadmania test on x64 2014-06-07 12:51:48 -04:00
lookup.c Rename tests-clar to tests 2013-11-14 14:05:52 -08:00
lookupbypath.c Introduce cl_assert_equal_oid 2014-07-01 14:40:16 -04:00
message.c message: don't assume the comment char 2014-05-18 10:06:49 +02:00
peel.c peel: reject bad queries with EINVALIDSPEC 2014-11-22 18:55:22 +01:00
shortid.c Add failing test for git_object_short_id 2014-03-10 11:35:14 -07:00