From 88aef76635c012ac8dc770e0f97abc37980decf9 Mon Sep 17 00:00:00 2001 From: Sascha Cunz Date: Fri, 11 Jan 2013 02:45:55 +0100 Subject: Implement analog for 'git checkout --branch xxx ...' --- include/git2/clone.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/git2') diff --git a/include/git2/clone.h b/include/git2/clone.h index e299c155d..9bb92ebdd 100644 --- a/include/git2/clone.h +++ b/include/git2/clone.h @@ -57,6 +57,8 @@ GIT_BEGIN_DECL * the origin remote before the fetch is initiated. * - `remote_autotag` may be used to specify the autotag setting before the * initial fetch. + * - `checkout_branch` gives the name of the branch to checkout. NULL means + * use the remote's HEAD. */ typedef struct git_clone_options { @@ -76,6 +78,7 @@ typedef struct git_clone_options { git_transport *transport; git_remote_callbacks *remote_callbacks; git_remote_autotag_option_t remote_autotag; + const char* checkout_branch; } git_clone_options; #define GIT_CLONE_OPTIONS_VERSION 1 -- cgit v1.2.1 From f31cae8be9e6005148b2e5bafcb46a0d4c77b467 Mon Sep 17 00:00:00 2001 From: Sascha Cunz Date: Sat, 12 Jan 2013 05:51:00 +0100 Subject: Default git_clone_options' checkout strategy to GIT_CHECKOUT_SAFE_CREATE --- include/git2/clone.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/git2') diff --git a/include/git2/clone.h b/include/git2/clone.h index 9bb92ebdd..b54676874 100644 --- a/include/git2/clone.h +++ b/include/git2/clone.h @@ -82,7 +82,7 @@ typedef struct git_clone_options { } git_clone_options; #define GIT_CLONE_OPTIONS_VERSION 1 -#define GIT_CLONE_OPTIONS_INIT {GIT_CLONE_OPTIONS_VERSION, {GIT_CHECKOUT_OPTS_VERSION, GIT_CHECKOUT_SAFE}} +#define GIT_CLONE_OPTIONS_INIT {GIT_CLONE_OPTIONS_VERSION, {GIT_CHECKOUT_OPTS_VERSION, GIT_CHECKOUT_SAFE_CREATE}} /** * Clone a remote repository, and checkout the branch pointed to by the remote -- cgit v1.2.1