libgit2

git_object_rawcontent_is_valid

Version:

Analyzes a buffer of raw object content and determines its validity. Tree, commit, and tag objects will be parsed and ensured that they are valid, parseable content. (Blobs are always valid by definition.) An error message will be set with an informative message if the object is not valid.

Warnings

  • This function is experimental and its signature may change in the future.

Signature

int git_object_rawcontent_is_valid(int *valid, const char *buf, size_t len, git_object_t object_type);

Parameters

int *
In
valid

Output pointer to set with validity of the object content

const char *
In
buf

The contents to validate

size_t
In
len

The length of the buffer

In
object_type

The type of the object in the buffer

Returns

int

0 on success or an error code

Versions