libgit2

git_commit_create_from_tree

Version:

A "batteries included" commit creation from a tree using defaults.

By default, empty commits are not allowed.

Signature

int git_commit_create_from_tree(git_oid *id, git_repository *repo, const git_tree *tree, const char *message, const git_commit_create_options *opts);

Parameters

In
id

pointer to store the new commit's object id

In
repo

repository to commit changes in

In
tree

tree to point the commit to

const char *
In
message

the commit message

In
opts

options for creating the commit

Returns

int

0 on success, GIT_EUNCHANGED if there were no changes to commit, or an error code

Versions