libgit2

git_object_write

Version:

Write back an object to disk.

The object will be written to its corresponding repository.

If the object has no changes since it was first read from the repository, no actions will take place.

If the object has been modified since it was read from the repository, or it has been created from scratch in memory, it will be written to the repository and its SHA1 ID will be updated accordingly.

Signature

int git_object_write(git_object *object);

Parameters

git_object *
In
object

Git object to write back

Returns

int

0 on success; otherwise an error code

Versions