Вызовите git_commit_create
с тем же деревом, что и родительский коммит. То есть:
// Get parent somehow.
git_commit *parent = ...;
// Use the same tree as the parent.
git_tree *tree;
git_commit_tree(&tree, parent);
// Create the commit.
git_commit_create(..., tree, 1, parent);