summaryrefslogtreecommitdiff
path: root/include/git2/clone.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-09-16 05:10:55 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2013-10-02 06:41:42 +0200
commitd19870d947eef17008ae0b4b7ebc9e9d0038a770 (patch)
tree48566589f6270d15d92507842e8f9eda32e19c03 /include/git2/clone.h
parente3c131c544bc79573ebefab4931b5ca89836ace1 (diff)
downloadlibgit2-d19870d947eef17008ae0b4b7ebc9e9d0038a770.tar.gz
clone: implement git_clone_into
This allows you to set up the repository and remote as you which to have them before performing the clone operation.
Diffstat (limited to 'include/git2/clone.h')
-rw-r--r--include/git2/clone.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/git2/clone.h b/include/git2/clone.h
index 38c759f6e..c3936f6b0 100644
--- a/include/git2/clone.h
+++ b/include/git2/clone.h
@@ -99,6 +99,22 @@ GIT_EXTERN(int) git_clone(
const char *local_path,
const git_clone_options *options);
+/**
+ * Clone into a repository
+ *
+ * After creating the repository and remote and configuring them for
+ * paths and callbacks respectively, you can call this function to
+ * perform the clone operation and optionally checkout files.
+ *
+ * @param repo the repository to use
+ * @param remote the remote repository to clone from
+ * @param co_opts options to use during checkout
+ * @param branch the branch to checkout after the clone, pass NULL for the remote's
+ * default branch
+ * @return 0 on success or an error code
+ */
+GIT_EXTERN(int) git_clone_into(git_repository *repo, git_remote *remote, git_checkout_opts *co_opts, const char *branch);
+
/** @} */
GIT_END_DECL
#endif