git_index_write_tree

Write the index as a tree

This method will scan the index and write a representation of its current state back to disk; it recursively creates tree objects for each of the subtrees stored in the index, but only returns the OID of the root tree. This is the OID that can be used e.g. to create a commit.

The index instance cannot be bare, and needs to be associated to an existing repository.

The index must not contain any file in conflict.

extern (C) nothrow @nogc public
int
git_index_write_tree

Parameters

out_ libgit2.oid.git_oid*

Pointer where to store the OID of the written tree

index libgit2.types.git_index*

Index to write

Return Value

Type: int

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

Meta