libgit2

git_submodule_set_branch

Version:

Set the branch for the submodule in the configuration

After calling this, you may wish to call git_submodule_sync() to write the changes to the checked out submodule repository.

Signature

int git_submodule_set_branch(git_repository *repo, const char *name, const char *branch);

Parameters

In
repo

the repository to affect

const char *
In
name

the name of the submodule to configure

const char *
In
branch

Branch that should be used for the submodule

Returns

int

0 on success, < 0 on failure

Versions