diff options
Diffstat (limited to 'include/git2/submodule.h')
| -rw-r--r-- | include/git2/submodule.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/git2/submodule.h b/include/git2/submodule.h index 245b2a2c1..86f5fef22 100644 --- a/include/git2/submodule.h +++ b/include/git2/submodule.h @@ -371,6 +371,22 @@ GIT_EXTERN(int) git_submodule_resolve_url(git_buf *out, git_repository *repo, co GIT_EXTERN(const char *) git_submodule_branch(git_submodule *submodule); /** + * Set the branch for the submodule. + * + * This sets the branch in memory for the submodule. This will be used for + * any following submodule actions while this submodule data is in memory. + * + * After calling this, you may wish to call `git_submodule_save()` to write + * the changes back to the ".gitmodules" file and `git_submodule_sync()` to + * write the changes to the checked out submodule repository. + * + * @param submodule Pointer to the submodule object + * @param branch Branch that should be used for the submodule + * @return 0 on success, <0 on failure + */ +GIT_EXTERN(int) git_submodule_set_branch(git_submodule *submodule, const char *branch); + +/** * Set the URL for the submodule. * * This sets the URL in memory for the submodule. This will be used for |
