summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2015-04-17 12:35:41 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2015-04-17 12:35:41 -0500
commita0e652d281dd2152d333675b25aa37307496e039 (patch)
tree429272b8d7f81f5df502fc4faaef36be5c7c2638 /include/git2
parenta5bf599c9d2bd934823fbd99e73d6378289e5dfb (diff)
parent129788a623816e06eb502235451beeb87472cee0 (diff)
downloadlibgit2-a0e652d281dd2152d333675b25aa37307496e039.tar.gz
Merge pull request #2999 from pks-t/submodule-set-url
Implement git_submodule_set_branch.
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/submodule.h16
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