libgit2

git_odb_open_rstream

Version:

Open a stream to read an object from the ODB

Note that most backends do not support streaming reads because they store their objects as compressed/delta'ed blobs.

It's recommended to use git_odb_read instead, which is assured to work on all backends.

The returned stream will be of type GIT_STREAM_RDONLY and will have the following methods:

  • stream->read: read n bytes from the stream - stream->free: free the stream

The stream must always be free'd or will leak memory.

See

Signature

int git_odb_open_rstream(git_odb_stream **stream, git_odb *db, const git_oid *oid);

Parameters

In
stream

pointer where to store the stream

In
db

object database where the stream will read from

In
oid

oid of the object the stream will read from

Returns

int

0 if the stream was created; error code otherwise

Versions