diff options
Diffstat (limited to 'include/git2')
-rw-r--r-- | include/git2/checkout.h | 29 | ||||
-rw-r--r-- | include/git2/clone.h | 18 |
2 files changed, 26 insertions, 21 deletions
diff --git a/include/git2/checkout.h b/include/git2/checkout.h index ff1c4132a..6e0a05f7c 100644 --- a/include/git2/checkout.h +++ b/include/git2/checkout.h @@ -22,26 +22,17 @@ GIT_BEGIN_DECL -#define GIT_CHECKOUT_OVERWRITE_EXISTING 0 +#define GIT_CHECKOUT_OVERWRITE_EXISTING 0 /* default */ #define GIT_CHECKOUT_SKIP_EXISTING 1 - +/* Use zeros to indicate default settings */ typedef struct git_checkout_opts { - git_indexer_stats stats; - int existing_file_action; - int apply_filters; - int dir_mode; - int file_open_mode; + int existing_file_action; /* default: GIT_CHECKOUT_OVERWRITE_EXISTING */ + int disable_filters; + int dir_mode; /* default is 0755 */ + int file_open_mode; /* default is O_CREAT | O_TRUNC | O_WRONLY */ } git_checkout_opts; -#define GIT_CHECKOUT_DEFAULT_OPTS { \ - {0}, \ - GIT_CHECKOUT_OVERWRITE_EXISTING, \ - true, \ - GIT_DIR_MODE, \ - O_CREAT|O_TRUNC|O_WRONLY \ -} - /** * Updates files in the working tree to match the index. * @@ -49,7 +40,9 @@ typedef struct git_checkout_opts { * @param opts specifies checkout options (may be NULL) * @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_EXTERN(int) git_checkout_index(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. @@ -58,7 +51,9 @@ GIT_EXTERN(int) git_checkout_index(git_repository *repo, git_checkout_opts *opts * @param opts specifies checkout options (may be NULL) * @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_EXTERN(int) git_checkout_head(git_repository *repo, + git_checkout_opts *opts, + git_indexer_stats *stats); /** @} */ GIT_END_DECL diff --git a/include/git2/clone.h b/include/git2/clone.h index 5468f09be..73b6ea54c 100644 --- a/include/git2/clone.h +++ b/include/git2/clone.h @@ -10,6 +10,7 @@ #include "common.h" #include "types.h" #include "indexer.h" +#include "checkout.h" /** @@ -27,10 +28,16 @@ GIT_BEGIN_DECL * @param out pointer that will receive the resulting repository object * @param origin_url repository to clone from * @param workdir_path local directory to clone to - * @param stats pointer to structure that receives progress information (may be NULL) + * @param fetch_stats pointer to structure that receives fetch progress information (may be NULL) + * @param checkout_opts options for the checkout step (may be NULL) * @return 0 on success, GIT_ERROR otherwise (use git_error_last for information about the error) */ -GIT_EXTERN(int) git_clone(git_repository **out, const char *origin_url, const char *workdir_path, git_indexer_stats *stats); +GIT_EXTERN(int) git_clone(git_repository **out, + const char *origin_url, + const char *workdir_path, + git_indexer_stats *fetch_stats, + git_indexer_stats *checkout_stats, + git_checkout_opts *checkout_opts); /** * TODO @@ -38,10 +45,13 @@ GIT_EXTERN(int) git_clone(git_repository **out, const char *origin_url, const ch * @param out pointer that will receive the resulting repository object * @param origin_url repository to clone from * @param dest_path local directory to clone to - * @param stats pointer to structure that receives progress information (may be NULL) + * @param fetch_stats pointer to structure that receives fetch progress information (may be NULL) * @return 0 on success, GIT_ERROR otherwise (use git_error_last for information about the error) */ -GIT_EXTERN(int) git_clone_bare(git_repository **out, const char *origin_url, const char *dest_path, git_indexer_stats *stats); +GIT_EXTERN(int) git_clone_bare(git_repository **out, + const char *origin_url, + const char *dest_path, + git_indexer_stats *fetch_stats); /** @} */ GIT_END_DECL |