diff options
author | Ben Straub <bstraub@github.com> | 2012-07-27 20:29:06 -0700 |
---|---|---|
committer | Ben Straub <bstraub@github.com> | 2012-07-27 20:31:05 -0700 |
commit | b31667fb695dab0510cc5fc259e0569ff2a2ef41 (patch) | |
tree | 859bd97b8f4ec70a9605385fadea1da108556541 /include/git2/checkout.h | |
parent | 4d83399d35f0d3d489c50f2358bd5481a90ddce5 (diff) | |
download | libgit2-b31667fb695dab0510cc5fc259e0569ff2a2ef41.tar.gz |
Checkout: add head- and ref-centric checkouts.
Renamed git_checkout_index to what it really was,
and removed duplicate code from clone.c. Added
git_checkout_ref, which updates HEAD and hands off
to git_checkout_head.
Added tests for the options the caller can pass to
git_checkout_*.
Diffstat (limited to 'include/git2/checkout.h')
-rw-r--r-- | include/git2/checkout.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/include/git2/checkout.h b/include/git2/checkout.h index 7a32cffa8..78367c29f 100644 --- a/include/git2/checkout.h +++ b/include/git2/checkout.h @@ -35,26 +35,31 @@ typedef struct git_checkout_opts { } git_checkout_opts; /** - * Updates files in the working tree to match the index. + * Updates files in the working tree to match the commit pointed to by HEAD. * * @param repo repository to check out (must be non-bare) * @param opts specifies checkout options (may be NULL) + * @param stats structure through which progress information is reported * @return 0 on success, GIT_ERROR otherwise (use git_error_last for information about the error) */ -GIT_EXTERN(int) git_checkout_index(git_repository *repo, - git_checkout_opts *opts, - git_indexer_stats *stats); +GIT_EXTERN(int) git_checkout_head(git_repository *repo, + git_checkout_opts *opts, + git_indexer_stats *stats); + + /** - * Updates files in the working tree to match the commit pointed to by HEAD. + * Updates files in the working tree to match a commit pointed to by a ref. * - * @param repo repository to check out (must be non-bare) + * @param ref reference to follow to a commit * @param opts specifies checkout options (may be NULL) + * @param stats structure through which progress information is reported * @return 0 on success, GIT_ERROR otherwise (use git_error_last for information about the error) */ -GIT_EXTERN(int) git_checkout_head(git_repository *repo, - git_checkout_opts *opts, - git_indexer_stats *stats); +GIT_EXTERN(int) git_checkout_reference(git_reference *ref, + git_checkout_opts *opts, + git_indexer_stats *stats); + /** @} */ GIT_END_DECL |