libgit2

git_submodule_add_to_index

Version:

Add current submodule HEAD commit to index of superproject.

Signature

int git_submodule_add_to_index(git_submodule *submodule, int write_index);

Parameters

In
submodule

The submodule to add to the index

int
In
write_index

Boolean if this should immediately write the index file. If you pass this as false, you will have to get the git_index and explicitly call git_index_write() on it to save the change.

Returns

int

0 on success, < 0 on failure

Versions