libgit2

git_tree_add_entry

Version:

Add a new entry to a tree and return the new entry.

This will mark the tree as modified; the new entry will be written back to disk on the next git_object_write()

Signature

int git_tree_add_entry(git_tree_entry **entry_out, git_tree *tree, const git_oid *id, const char *filename, int attributes);

Parameters

git_tree_entry **
In
entry_out

Pointer to the entry that just got created. May be NULL if you are not interested on getting the new entry

git_tree *
In
tree

Tree object to store the entry \iparam id OID for the tree entry

const char *
In
filename

Filename for the tree entry

int
In
attributes

UNIX file attributes for the entry

Returns

int

0 on success; otherwise error code

Versions