lib/core: Use GBytes for file headers
authorColin Walters <walters@verbum.org>
Sun, 8 Oct 2017 19:55:35 +0000 (15:55 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 11 Oct 2017 19:04:46 +0000 (19:04 +0000)
commitbb51a43d8111416bdd8225487ba803c34ad5b69b
treea9e6a42e56de43954b286c5d8c152e516b0b2974
parentd10593e65d504fd523ddfae5309a51ef189c841e
lib/core: Use GBytes for file headers

This simplifies a lot of code; the header function was structured
to write to an input stream, but many callers only wanted the checksum,
so it's simpler (and error-free) to simply allocate a whole buffer
and checksum that.

For the callers that want to write it, it's also still simpler to allocate the
buffer and write the whole thing rather than having this function do the
writing.

A lot of the complexity here again is a legacy of the packfile code, which is
dead.

This is prep for faster regfile commits where we can avoid `G{In,Out}putStream`.

Closes: #1257
Approved by: jlebon
src/libostree/ostree-core-private.h
src/libostree/ostree-core.c
src/libostree/ostree-repo-commit.c
src/libostree/ostree-repo-static-delta-processing.c
src/libotutil/ot-checksum-utils.h