libgit2

git_treebuilder_insert

Version:

Add or update an entry to the builder

Insert a new entry for filename in the builder with the given attributes.

if an entry named filename already exists, its attributes will be updated with the given ones.

The optional pointer entry_out can be used to retrieve a pointer to the newly created/updated entry.

Signature

int git_treebuilder_insert(git_tree_entry **entry_out, git_treebuilder *bld, const char *filename, const git_oid *id, unsigned int attributes);

Parameters

In
entry_out

Pointer to store the entry (optional)

In
bld

Tree builder

const char *
In
filename

Filename of the entry

In
id

SHA1 oid of the entry

unsigned int
In
attributes

Folder attributes of the entry

Returns

int

0 or an error code

Versions