libgit2

git_index_write_tree_to

Version:

Write the index as a tree to the given repository

This method will do the same as git_index_write_tree, but letting the user choose the repository where the tree will be written.

The index must not contain any file in conflict.

Signature

int git_index_write_tree_to(git_oid *out, git_index *index, git_repository *repo);

Parameters

In
out

Pointer where to store OID of the written tree

In
index

Index to write

In
repo

Repository where to write the tree

Returns

int

0 on success, GIT_EUNMERGED when the index is not clean or an error code

Versions