summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2013-01-12 02:14:14 -0800
committerVicent Martí <vicent@github.com>2013-01-12 02:14:14 -0800
commite2d2c6e57d122f381fb42b7df1c7a12819050490 (patch)
tree9cb5f2f9a9b4051cab640efb518f4fb0d87d3453 /include/git2
parent355dddbf08ade85584f94dfb0eb4df46cb504035 (diff)
parentf31cae8be9e6005148b2e5bafcb46a0d4c77b467 (diff)
downloadlibgit2-e2d2c6e57d122f381fb42b7df1c7a12819050490.tar.gz
Merge pull request #1222 from scunz/clone_branch
Switch to specified branch during clone
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/clone.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/git2/clone.h b/include/git2/clone.h
index e299c155d..b54676874 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,10 +78,11 @@ 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
-#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