From 17b06f4d47bfd9fae8073c85d71751df94e50050 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Fri, 7 Sep 2012 15:49:08 -0700 Subject: Add missing accessor for fetchRecurseSubmodules When `git_submodule` became an opaque structure, I forgot to add accessor functions for the fetchRecurseSubmodules config setting. This fixes that. --- include/git2/submodule.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'include/git2') diff --git a/include/git2/submodule.h b/include/git2/submodule.h index fe7f26cf..28057d26 100644 --- a/include/git2/submodule.h +++ b/include/git2/submodule.h @@ -395,6 +395,35 @@ GIT_EXTERN(git_submodule_update_t) git_submodule_set_update( git_submodule *submodule, git_submodule_update_t update); +/** + * Read the fetchRecurseSubmodules rule for a submodule. + * + * This accesses the submodule..fetchRecurseSubmodules value for + * the submodule that controls fetching behavior for the submodule. + * + * Note that at this time, libgit2 does not honor this setting and the + * fetch functionality current ignores submodules. + * + * @return 0 if fetchRecurseSubmodules is false, 1 if true + */ +GIT_EXTERN(int) git_submodule_fetch_recurse_submodules( + git_submodule *submodule); + +/** + * Set the fetchRecurseSubmodules rule for a submodule. + * + * This sets the submodule..fetchRecurseSubmodules value for + * the submodule. You should call `git_submodule_save()` if you want + * to persist the new value. + * + * @param submodule The submodule to modify + * @param fetch_recurse_submodules Boolean value + * @return old value for fetchRecurseSubmodules + */ +GIT_EXTERN(int) git_submodule_set_fetch_recurse_submodules( + git_submodule *submodule, + int fetch_recurse_submodules); + /** * Copy submodule info into ".git/config" file. * -- cgit v1.2.1