From 6affd71f33f9a9693425d6f3599ba1f25226c34b Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Fri, 3 Jan 2014 17:38:34 -0800 Subject: [PATCH] git_checkout_opts -> git_checkout_options --- examples/network/clone.c | 2 +- include/git2/checkout.h | 28 +++++++++---------- include/git2/clone.h | 6 ++--- include/git2/merge.h | 4 +-- include/git2/revert.h | 4 +-- src/checkout.c | 28 +++++++++---------- src/checkout.h | 2 +- src/clone.c | 4 +-- src/reset.c | 2 +- src/stash.c | 2 +- tests/checkout/binaryunicode.c | 2 +- tests/checkout/conflict.c | 34 +++++++++++------------ tests/checkout/crlf.c | 49 +++++++++++++++++++++++++--------- tests/checkout/head.c | 2 +- tests/checkout/index.c | 46 +++++++++++++++---------------- tests/checkout/tree.c | 36 ++++++++++++------------- tests/checkout/typechange.c | 4 +-- tests/clone/nonetwork.c | 2 +- tests/diff/rename.c | 6 ++--- tests/index/names.c | 6 ++--- tests/index/reuc.c | 6 ++--- tests/merge/merge_helpers.c | 2 +- tests/merge/workdir/trivial.c | 2 +- tests/online/clone.c | 4 +-- tests/structinit/structinit.c | 4 +-- 25 files changed, 156 insertions(+), 131 deletions(-) diff --git a/examples/network/clone.c b/examples/network/clone.c index a982c13c2..182d1c35b 100644 --- a/examples/network/clone.c +++ b/examples/network/clone.c @@ -62,7 +62,7 @@ int do_clone(git_repository *repo, int argc, char **argv) progress_data pd = {{0}}; git_repository *cloned_repo = NULL; git_clone_options clone_opts = GIT_CLONE_OPTIONS_INIT; - git_checkout_opts checkout_opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; const char *url = argv[1]; const char *path = argv[2]; int error; diff --git a/include/git2/checkout.h b/include/git2/checkout.h index 702e088d9..69addb7d9 100644 --- a/include/git2/checkout.h +++ b/include/git2/checkout.h @@ -225,12 +225,12 @@ typedef void (*git_checkout_progress_cb)( /** * Checkout options structure * - * Zero out for defaults. Initialize with `GIT_CHECKOUT_OPTS_INIT` macro to + * Zero out for defaults. Initialize with `GIT_CHECKOUT_OPTIONS_INIT` macro to * correctly set the `version` field. E.g. * - * git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + * git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; */ -typedef struct git_checkout_opts { +typedef struct git_checkout_options { unsigned int version; unsigned int checkout_strategy; /** default will be a dry run */ @@ -261,22 +261,22 @@ typedef struct git_checkout_opts { const char *ancestor_label; /** the name of the common ancestor side of conflicts */ const char *our_label; /** the name of the "our" side of conflicts */ const char *their_label; /** the name of the "their" side of conflicts */ -} git_checkout_opts; +} git_checkout_options; -#define GIT_CHECKOUT_OPTS_VERSION 1 -#define GIT_CHECKOUT_OPTS_INIT {GIT_CHECKOUT_OPTS_VERSION} +#define GIT_CHECKOUT_OPTIONS_VERSION 1 +#define GIT_CHECKOUT_OPTIONS_INIT {GIT_CHECKOUT_OPTIONS_VERSION} /** -* Initializes a `git_checkout_opts` with default values. Equivalent to -* creating an instance with GIT_CHECKOUT_OPTS_INIT. +* Initializes a `git_checkout_options` with default values. Equivalent to +* creating an instance with GIT_CHECKOUT_OPTIONS_INIT. * -* @param opts the `git_checkout_opts` instance to initialize. +* @param opts the `git_checkout_options` instance to initialize. * @param version the version of the struct; you should pass -* `GIT_CHECKOUT_OPTS_VERSION` here. +* `GIT_CHECKOUT_OPTIONS_VERSION` here. * @return Zero on success; -1 on failure. */ GIT_EXTERN(int) git_checkout_init_opts( - git_checkout_opts* opts, + git_checkout_options* opts, int version); /** @@ -291,7 +291,7 @@ GIT_EXTERN(int) git_checkout_init_opts( */ GIT_EXTERN(int) git_checkout_head( git_repository *repo, - const git_checkout_opts *opts); + const git_checkout_options *opts); /** * Updates files in the working tree to match the content of the index. @@ -305,7 +305,7 @@ GIT_EXTERN(int) git_checkout_head( GIT_EXTERN(int) git_checkout_index( git_repository *repo, git_index *index, - const git_checkout_opts *opts); + const git_checkout_options *opts); /** * Updates files in the index and working tree to match the content of the @@ -321,7 +321,7 @@ GIT_EXTERN(int) git_checkout_index( GIT_EXTERN(int) git_checkout_tree( git_repository *repo, const git_object *treeish, - const git_checkout_opts *opts); + const git_checkout_options *opts); /** @} */ GIT_END_DECL diff --git a/include/git2/clone.h b/include/git2/clone.h index 98c6fb7d7..20be1a105 100644 --- a/include/git2/clone.h +++ b/include/git2/clone.h @@ -52,7 +52,7 @@ GIT_BEGIN_DECL typedef struct git_clone_options { unsigned int version; - git_checkout_opts checkout_opts; + git_checkout_options checkout_opts; git_remote_callbacks remote_callbacks; int bare; @@ -63,7 +63,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_CREATE}, GIT_REMOTE_CALLBACKS_INIT} +#define GIT_CLONE_OPTIONS_INIT {GIT_CLONE_OPTIONS_VERSION, {GIT_CHECKOUT_OPTIONS_VERSION, GIT_CHECKOUT_SAFE_CREATE}, GIT_REMOTE_CALLBACKS_INIT} /** * Initializes a `git_clone_options` with default values. Equivalent to @@ -120,7 +120,7 @@ GIT_EXTERN(int) git_clone( GIT_EXTERN(int) git_clone_into( git_repository *repo, git_remote *remote, - const git_checkout_opts *co_opts, + const git_checkout_options *co_opts, const char *branch, const git_signature *signature); diff --git a/include/git2/merge.h b/include/git2/merge.h index dc89a0482..3563f35d5 100644 --- a/include/git2/merge.h +++ b/include/git2/merge.h @@ -150,11 +150,11 @@ typedef struct { git_merge_tree_opts merge_tree_opts; /** Options for writing the merge result to the working directory. */ - git_checkout_opts checkout_opts; + git_checkout_options checkout_opts; } git_merge_opts; #define GIT_MERGE_OPTS_VERSION 1 -#define GIT_MERGE_OPTS_INIT {GIT_MERGE_OPTS_VERSION, 0, GIT_MERGE_TREE_OPTS_INIT, GIT_CHECKOUT_OPTS_INIT} +#define GIT_MERGE_OPTS_INIT {GIT_MERGE_OPTS_VERSION, 0, GIT_MERGE_TREE_OPTS_INIT, GIT_CHECKOUT_OPTIONS_INIT} /** * Initializes a `git_merge_opts` with default values. Equivalent to creating diff --git a/include/git2/revert.h b/include/git2/revert.h index 088bda94d..fcdf2a2ca 100644 --- a/include/git2/revert.h +++ b/include/git2/revert.h @@ -27,11 +27,11 @@ typedef struct { unsigned int mainline; git_merge_tree_opts merge_tree_opts; - git_checkout_opts checkout_opts; + git_checkout_options checkout_opts; } git_revert_opts; #define GIT_REVERT_OPTS_VERSION 1 -#define GIT_REVERT_OPTS_INIT {GIT_REVERT_OPTS_VERSION, 0, GIT_MERGE_TREE_OPTS_INIT, GIT_CHECKOUT_OPTS_INIT} +#define GIT_REVERT_OPTS_INIT {GIT_REVERT_OPTS_VERSION, 0, GIT_MERGE_TREE_OPTS_INIT, GIT_CHECKOUT_OPTIONS_INIT} /** * Initializes a `git_revert_opts` with default values. Equivalent to diff --git a/src/checkout.c b/src/checkout.c index 4ef8da076..5dd4ec71c 100644 --- a/src/checkout.c +++ b/src/checkout.c @@ -47,7 +47,7 @@ enum { typedef struct { git_repository *repo; git_diff *diff; - git_checkout_opts opts; + git_checkout_options opts; bool opts_free_baseline; char *pfx; git_index *index; @@ -1144,7 +1144,7 @@ static int blob_content_to_file( const char *path, const char * hint_path, mode_t entry_filemode, - git_checkout_opts *opts) + git_checkout_options *opts) { int error = 0; mode_t file_mode = opts->file_mode ? opts->file_mode : entry_filemode; @@ -1856,7 +1856,7 @@ static void checkout_data_clear(checkout_data *data) static int checkout_data_init( checkout_data *data, git_iterator *target, - const git_checkout_opts *proposed) + const git_checkout_options *proposed) { int error = 0; git_repository *repo = git_iterator_owner(target); @@ -1875,12 +1875,12 @@ static int checkout_data_init( data->repo = repo; GITERR_CHECK_VERSION( - proposed, GIT_CHECKOUT_OPTS_VERSION, "git_checkout_opts"); + proposed, GIT_CHECKOUT_OPTIONS_VERSION, "git_checkout_options"); if (!proposed) - GIT_INIT_STRUCTURE(&data->opts, GIT_CHECKOUT_OPTS_VERSION); + GIT_INIT_STRUCTURE(&data->opts, GIT_CHECKOUT_OPTIONS_VERSION); else - memmove(&data->opts, proposed, sizeof(git_checkout_opts)); + memmove(&data->opts, proposed, sizeof(git_checkout_options)); if (!data->opts.target_directory) data->opts.target_directory = git_repository_workdir(repo); @@ -2000,7 +2000,7 @@ cleanup: int git_checkout_iterator( git_iterator *target, - const git_checkout_opts *opts) + const git_checkout_options *opts) { int error = 0; git_iterator *baseline = NULL, *workdir = NULL; @@ -2106,7 +2106,7 @@ cleanup: int git_checkout_index( git_repository *repo, git_index *index, - const git_checkout_opts *opts) + const git_checkout_options *opts) { int error; git_iterator *index_i; @@ -2141,7 +2141,7 @@ int git_checkout_index( int git_checkout_tree( git_repository *repo, const git_object *treeish, - const git_checkout_opts *opts) + const git_checkout_options *opts) { int error; git_tree *tree = NULL; @@ -2189,19 +2189,19 @@ int git_checkout_tree( int git_checkout_head( git_repository *repo, - const git_checkout_opts *opts) + const git_checkout_options *opts) { assert(repo); return git_checkout_tree(repo, NULL, opts); } -int git_checkout_init_opts(git_checkout_opts* opts, int version) +int git_checkout_init_opts(git_checkout_options* opts, int version) { - if (version != GIT_CHECKOUT_OPTS_VERSION) { - giterr_set(GITERR_INVALID, "Invalid version %d for git_checkout_opts", version); + if (version != GIT_CHECKOUT_OPTIONS_VERSION) { + giterr_set(GITERR_INVALID, "Invalid version %d for git_checkout_options", version); return -1; } else { - git_checkout_opts o = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options o = GIT_CHECKOUT_OPTIONS_INIT; memcpy(opts, &o, sizeof(o)); return 0; } diff --git a/src/checkout.h b/src/checkout.h index 6d7186860..f1fe69628 100644 --- a/src/checkout.h +++ b/src/checkout.h @@ -19,6 +19,6 @@ */ extern int git_checkout_iterator( git_iterator *target, - const git_checkout_opts *opts); + const git_checkout_options *opts); #endif diff --git a/src/clone.c b/src/clone.c index b5333bdb7..e19d02ba2 100644 --- a/src/clone.c +++ b/src/clone.c @@ -322,7 +322,7 @@ on_error: static bool should_checkout( git_repository *repo, bool is_bare, - const git_checkout_opts *opts) + const git_checkout_options *opts) { if (is_bare) return false; @@ -336,7 +336,7 @@ static bool should_checkout( return !git_repository_head_unborn(repo); } -int git_clone_into(git_repository *repo, git_remote *remote, const git_checkout_opts *co_opts, const char *branch, const git_signature *signature) +int git_clone_into(git_repository *repo, git_remote *remote, const git_checkout_options *co_opts, const char *branch, const git_signature *signature) { int error = 0, old_fetchhead; git_strarray refspecs; diff --git a/src/reset.c b/src/reset.c index 07fd08863..45a686fcb 100644 --- a/src/reset.c +++ b/src/reset.c @@ -102,7 +102,7 @@ int git_reset( git_index *index = NULL; git_tree *tree = NULL; int error = 0; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_buf log_message_buf = GIT_BUF_INIT; assert(repo && target); diff --git a/src/stash.c b/src/stash.c index 0c9101294..d20e29b80 100644 --- a/src/stash.c +++ b/src/stash.c @@ -468,7 +468,7 @@ static int reset_index_and_workdir( bool remove_untracked, bool remove_ignored) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_FORCE; diff --git a/tests/checkout/binaryunicode.c b/tests/checkout/binaryunicode.c index 14ab9fdfa..1172816c7 100644 --- a/tests/checkout/binaryunicode.c +++ b/tests/checkout/binaryunicode.c @@ -21,7 +21,7 @@ static void execute_test(void) git_oid oid, check; git_commit *commit; git_tree *tree; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; cl_git_pass(git_reference_name_to_id(&oid, g_repo, "refs/heads/branch1")); cl_git_pass(git_commit_lookup(&commit, g_repo, &oid)); diff --git a/tests/checkout/conflict.c b/tests/checkout/conflict.c index 2fea511da..2cb7c224d 100644 --- a/tests/checkout/conflict.c +++ b/tests/checkout/conflict.c @@ -207,7 +207,7 @@ static void ensure_workdir_link(const char *path, const char *target) void test_checkout_conflict__ignored(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy |= GIT_CHECKOUT_SKIP_UNMERGED; @@ -221,7 +221,7 @@ void test_checkout_conflict__ignored(void) void test_checkout_conflict__ours(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy |= GIT_CHECKOUT_USE_OURS; @@ -234,7 +234,7 @@ void test_checkout_conflict__ours(void) void test_checkout_conflict__theirs(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy |= GIT_CHECKOUT_USE_THEIRS; @@ -248,7 +248,7 @@ void test_checkout_conflict__theirs(void) void test_checkout_conflict__diff3(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; create_conflicting_index(); @@ -259,7 +259,7 @@ void test_checkout_conflict__diff3(void) void test_checkout_conflict__automerge(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; struct checkout_index_entry checkout_index_entries[] = { { 0100644, AUTOMERGEABLE_ANCESTOR_OID, 1, "automergeable.txt" }, @@ -277,7 +277,7 @@ void test_checkout_conflict__automerge(void) void test_checkout_conflict__directory_file(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; struct checkout_index_entry checkout_index_entries[] = { { 0100644, CONFLICTING_ANCESTOR_OID, 1, "df-1" }, @@ -316,7 +316,7 @@ void test_checkout_conflict__directory_file(void) void test_checkout_conflict__directory_file_with_custom_labels(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; struct checkout_index_entry checkout_index_entries[] = { { 0100644, CONFLICTING_ANCESTOR_OID, 1, "df-1" }, @@ -357,7 +357,7 @@ void test_checkout_conflict__directory_file_with_custom_labels(void) void test_checkout_conflict__link_file(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; struct checkout_index_entry checkout_index_entries[] = { { 0100644, CONFLICTING_ANCESTOR_OID, 1, "link-1" }, @@ -393,7 +393,7 @@ void test_checkout_conflict__link_file(void) void test_checkout_conflict__links(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; struct checkout_index_entry checkout_index_entries[] = { { 0120000, LINK_ANCESTOR_OID, 1, "link-1" }, @@ -418,7 +418,7 @@ void test_checkout_conflict__links(void) void test_checkout_conflict__add_add(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; struct checkout_index_entry checkout_index_entries[] = { { 0100644, CONFLICTING_OURS_OID, 2, "conflicting.txt" }, @@ -438,7 +438,7 @@ void test_checkout_conflict__add_add(void) void test_checkout_conflict__mode_change(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; struct checkout_index_entry checkout_index_entries[] = { { 0100644, CONFLICTING_ANCESTOR_OID, 1, "executable-1" }, @@ -495,7 +495,7 @@ void test_checkout_conflict__mode_change(void) void test_checkout_conflict__renames(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; struct checkout_index_entry checkout_index_entries[] = { { 0100644, "68c6c84b091926c7d90aa6a79b2bc3bb6adccd8e", 0, "0a-no-change.txt" }, @@ -680,7 +680,7 @@ void test_checkout_conflict__renames(void) void test_checkout_conflict__rename_keep_ours(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; struct checkout_index_entry checkout_index_entries[] = { { 0100644, "68c6c84b091926c7d90aa6a79b2bc3bb6adccd8e", 0, "0a-no-change.txt" }, @@ -847,7 +847,7 @@ void test_checkout_conflict__rename_keep_ours(void) void test_checkout_conflict__name_mangled_file_exists_in_workdir(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; struct checkout_index_entry checkout_index_entries[] = { { 0100644, "b42712cfe99a1a500b2a51fe984e0b8a7702ba11", 1, "test-one-side-one.txt" }, @@ -987,7 +987,7 @@ void test_checkout_conflict__name_mangled_file_exists_in_workdir(void) void test_checkout_conflict__update_only(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; struct checkout_index_entry checkout_index_entries[] = { { 0100644, AUTOMERGEABLE_ANCESTOR_OID, 1, "automergeable.txt" }, @@ -1032,7 +1032,7 @@ void test_checkout_conflict__update_only(void) void test_checkout_conflict__path_filters(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; char *paths[] = { "conflicting-1.txt", "conflicting-3.txt" }; git_strarray patharray = {0}; @@ -1089,7 +1089,7 @@ static void collect_progress( void test_checkout_conflict__report_progress(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_vector paths = GIT_VECTOR_INIT; char *path; size_t i; diff --git a/tests/checkout/crlf.c b/tests/checkout/crlf.c index 0d78ee039..6b2c1b122 100644 --- a/tests/checkout/crlf.c +++ b/tests/checkout/crlf.c @@ -18,11 +18,24 @@ void test_checkout_crlf__cleanup(void) cl_git_sandbox_cleanup(); } +void test_checkout_crlf__detect_crlf_autocrlf_false(void) +{ + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; + opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + + cl_repo_set_bool(g_repo, "core.autocrlf", false); + + git_checkout_head(g_repo, &opts); + + check_file_contents("./crlf/all-lf", ALL_LF_TEXT_RAW); + check_file_contents("./crlf/all-crlf", ALL_CRLF_TEXT_RAW); +} + void test_checkout_crlf__autocrlf_false_index_size_is_unfiltered_size(void) { git_index *index; const git_index_entry *entry; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; cl_repo_set_bool(g_repo, "core.autocrlf", false); @@ -42,7 +55,7 @@ void test_checkout_crlf__autocrlf_false_index_size_is_unfiltered_size(void) void test_checkout_crlf__detect_crlf_autocrlf_true(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; cl_repo_set_bool(g_repo, "core.autocrlf", true); @@ -59,7 +72,7 @@ void test_checkout_crlf__detect_crlf_autocrlf_true(void) void test_checkout_crlf__more_lf_autocrlf_true(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; cl_repo_set_bool(g_repo, "core.autocrlf", true); @@ -74,7 +87,7 @@ void test_checkout_crlf__more_lf_autocrlf_true(void) void test_checkout_crlf__more_crlf_autocrlf_true(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; cl_repo_set_bool(g_repo, "core.autocrlf", true); @@ -87,11 +100,23 @@ void test_checkout_crlf__more_crlf_autocrlf_true(void) check_file_contents("./crlf/more-crlf", MORE_CRLF_TEXT_AS_CRLF); } +void test_checkout_crlf__all_crlf_autocrlf_true(void) +{ + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; + opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; + + cl_repo_set_bool(g_repo, "core.autocrlf", true); + + git_checkout_head(g_repo, &opts); + + check_file_contents("./crlf/all-crlf", ALL_CRLF_TEXT_RAW); +} + void test_checkout_crlf__autocrlf_true_index_size_is_filtered_size(void) { git_index *index; const git_index_entry *entry; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; cl_repo_set_bool(g_repo, "core.autocrlf", true); @@ -117,7 +142,7 @@ void test_checkout_crlf__with_ident(void) { git_index *index; git_blob *blob; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; cl_git_mkfile("crlf/.gitattributes", @@ -207,7 +232,7 @@ void test_checkout_crlf__with_ident(void) void test_checkout_crlf__autocrlf_false_no_attrs(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; cl_repo_set_bool(g_repo, "core.autocrlf", false); @@ -220,7 +245,7 @@ void test_checkout_crlf__autocrlf_false_no_attrs(void) void test_checkout_crlf__autocrlf_true_no_attrs(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; cl_repo_set_bool(g_repo, "core.autocrlf", true); @@ -238,7 +263,7 @@ void test_checkout_crlf__autocrlf_true_no_attrs(void) void test_checkout_crlf__autocrlf_input_no_attrs(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; cl_repo_set_string(g_repo, "core.autocrlf", "input"); @@ -251,7 +276,7 @@ void test_checkout_crlf__autocrlf_input_no_attrs(void) void test_checkout_crlf__autocrlf_false_text_auto_attr(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; cl_git_mkfile("./crlf/.gitattributes", "* text=auto\n"); @@ -266,7 +291,7 @@ void test_checkout_crlf__autocrlf_false_text_auto_attr(void) void test_checkout_crlf__autocrlf_true_text_auto_attr(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; cl_git_mkfile("./crlf/.gitattributes", "* text=auto\n"); @@ -286,7 +311,7 @@ void test_checkout_crlf__autocrlf_true_text_auto_attr(void) void test_checkout_crlf__autocrlf_input_text_auto_attr(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; cl_git_mkfile("./crlf/.gitattributes", "* text=auto\n"); diff --git a/tests/checkout/head.c b/tests/checkout/head.c index a7a7e9071..07cc1d209 100644 --- a/tests/checkout/head.c +++ b/tests/checkout/head.c @@ -25,7 +25,7 @@ void test_checkout_head__unborn_head_returns_GIT_EUNBORNBRANCH(void) void test_checkout_head__with_index_only_tree(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_index *index; /* let's start by getting things into a known state */ diff --git a/tests/checkout/index.c b/tests/checkout/index.c index 57ce4313b..7f641b329 100644 --- a/tests/checkout/index.c +++ b/tests/checkout/index.c @@ -43,7 +43,7 @@ void test_checkout_index__cannot_checkout_a_bare_repository(void) void test_checkout_index__can_create_missing_files(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; cl_assert_equal_i(false, git_path_isfile("./testrepo/README")); cl_assert_equal_i(false, git_path_isfile("./testrepo/branch_file.txt")); @@ -60,7 +60,7 @@ void test_checkout_index__can_create_missing_files(void) void test_checkout_index__can_remove_untracked_files(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_futils_mkdir("./testrepo/dir/subdir/subsubdir", NULL, 0755, GIT_MKDIR_PATH); cl_git_mkfile("./testrepo/dir/one", "one\n"); @@ -78,7 +78,7 @@ void test_checkout_index__can_remove_untracked_files(void) void test_checkout_index__honor_the_specified_pathspecs(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; char *entries[] = { "*.txt" }; opts.paths.strings = entries; @@ -99,7 +99,7 @@ void test_checkout_index__honor_the_specified_pathspecs(void) void test_checkout_index__honor_the_gitattributes_directives(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; const char *attributes = "branch_file.txt text eol=crlf\n" "new.txt text eol=lf\n"; @@ -119,7 +119,7 @@ void test_checkout_index__honor_the_gitattributes_directives(void) void test_checkout_index__honor_coreautocrlf_setting_set_to_true(void) { #ifdef GIT_WIN32 - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; const char *expected_readme_text = "hey there\r\n"; cl_git_pass(p_unlink("./testrepo/.gitattributes")); @@ -135,7 +135,7 @@ void test_checkout_index__honor_coreautocrlf_setting_set_to_true(void) void test_checkout_index__honor_coresymlinks_setting_set_to_true(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; cl_repo_set_bool(g_repo, "core.symlinks", true); @@ -161,7 +161,7 @@ void test_checkout_index__honor_coresymlinks_setting_set_to_true(void) void test_checkout_index__honor_coresymlinks_setting_set_to_false(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; cl_repo_set_bool(g_repo, "core.symlinks", false); @@ -174,7 +174,7 @@ void test_checkout_index__honor_coresymlinks_setting_set_to_false(void) void test_checkout_index__donot_overwrite_modified_file_by_default(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; cl_git_mkfile("./testrepo/new.txt", "This isn't what's stored!"); @@ -190,7 +190,7 @@ void test_checkout_index__donot_overwrite_modified_file_by_default(void) void test_checkout_index__can_overwrite_modified_file(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; cl_git_mkfile("./testrepo/new.txt", "This isn't what's stored!"); @@ -203,7 +203,7 @@ void test_checkout_index__can_overwrite_modified_file(void) void test_checkout_index__options_disable_filters(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; cl_git_mkfile("./testrepo/.gitattributes", "*.txt text eol=crlf\n"); @@ -224,7 +224,7 @@ void test_checkout_index__options_disable_filters(void) void test_checkout_index__options_dir_modes(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; struct stat st; git_oid oid; git_commit *commit; @@ -258,7 +258,7 @@ void test_checkout_index__options_dir_modes(void) void test_checkout_index__options_override_file_modes(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; struct stat st; if (!cl_is_chmod_supported()) @@ -275,7 +275,7 @@ void test_checkout_index__options_override_file_modes(void) void test_checkout_index__options_open_flags(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; cl_git_mkfile("./testrepo/new.txt", "hi\n"); @@ -315,7 +315,7 @@ static int test_checkout_notify_cb( void test_checkout_index__can_notify_of_skipped_files(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; struct notify_data data; cl_git_mkfile("./testrepo/new.txt", "This isn't what's stored!"); @@ -360,7 +360,7 @@ static int dont_notify_cb( void test_checkout_index__wont_notify_of_expected_line_ending_changes(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; cl_git_pass(p_unlink("./testrepo/.gitattributes")); cl_repo_set_bool(g_repo, "core.autocrlf", true); @@ -385,7 +385,7 @@ static void checkout_progress_counter( void test_checkout_index__calls_progress_callback(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; int calls = 0; opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; @@ -398,7 +398,7 @@ void test_checkout_index__calls_progress_callback(void) void test_checkout_index__can_overcome_name_clashes(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_index *index; cl_git_pass(git_repository_index(&index, g_repo)); @@ -440,7 +440,7 @@ void test_checkout_index__can_overcome_name_clashes(void) void test_checkout_index__validates_struct_version(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; const git_error *err; opts.version = 1024; @@ -459,7 +459,7 @@ void test_checkout_index__validates_struct_version(void) void test_checkout_index__can_update_prefixed_files(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; cl_assert_equal_i(false, git_path_isfile("./testrepo/README")); cl_assert_equal_i(false, git_path_isfile("./testrepo/branch_file.txt")); @@ -502,7 +502,7 @@ void test_checkout_index__can_checkout_a_newly_initialized_repository(void) void test_checkout_index__issue_1397(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; test_checkout_index__cleanup(); @@ -519,7 +519,7 @@ void test_checkout_index__issue_1397(void) void test_checkout_index__target_directory(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; checkout_counts cts; memset(&cts, 0, sizeof(cts)); @@ -551,7 +551,7 @@ void test_checkout_index__target_directory(void) void test_checkout_index__target_directory_from_bare(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_index *index; git_object *head = NULL; checkout_counts cts; @@ -600,7 +600,7 @@ void test_checkout_index__target_directory_from_bare(void) void test_checkout_index__can_get_repo_from_index(void) { git_index *index; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; cl_assert_equal_i(false, git_path_isfile("./testrepo/README")); cl_assert_equal_i(false, git_path_isfile("./testrepo/branch_file.txt")); diff --git a/tests/checkout/tree.c b/tests/checkout/tree.c index f433b2698..b61ef2dfc 100644 --- a/tests/checkout/tree.c +++ b/tests/checkout/tree.c @@ -7,14 +7,14 @@ #include "fileops.h" static git_repository *g_repo; -static git_checkout_opts g_opts; +static git_checkout_options g_opts; static git_object *g_object; void test_checkout_tree__initialize(void) { g_repo = cl_git_sandbox_init("testrepo"); - GIT_INIT_STRUCTURE(&g_opts, GIT_CHECKOUT_OPTS_VERSION); + GIT_INIT_STRUCTURE(&g_opts, GIT_CHECKOUT_OPTIONS_VERSION); g_opts.checkout_strategy = GIT_CHECKOUT_SAFE_CREATE; } @@ -128,7 +128,7 @@ void test_checkout_tree__doesnt_write_unrequested_files_to_worktree(void) git_oid chomped_oid; git_commit* p_master_commit; git_commit* p_chomped_commit; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid_fromstr(&master_oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"); git_oid_fromstr(&chomped_oid, "e90810b8df3e80c413d903f631643c716887138d"); @@ -148,7 +148,7 @@ void test_checkout_tree__doesnt_write_unrequested_files_to_worktree(void) void test_checkout_tree__can_switch_branches(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid oid; git_object *obj = NULL; @@ -202,7 +202,7 @@ void test_checkout_tree__can_switch_branches(void) void test_checkout_tree__can_remove_untracked(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_REMOVE_UNTRACKED; @@ -216,7 +216,7 @@ void test_checkout_tree__can_remove_untracked(void) void test_checkout_tree__can_remove_ignored(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; int ignored = 0; opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_REMOVE_IGNORED; @@ -239,7 +239,7 @@ static int checkout_tree_with_blob_ignored_in_workdir(int strategy, bool isdir) { git_oid oid; git_object *obj = NULL; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; int ignored = 0, error; assert_on_branch(g_repo, "master"); @@ -344,7 +344,7 @@ void test_checkout_tree__can_overwrite_ignored_folder_by_default(void) void test_checkout_tree__can_update_only(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid oid; git_object *obj = NULL; @@ -554,7 +554,7 @@ void test_checkout_tree__checking_out_a_conflicting_content_change_returns_EMERG void test_checkout_tree__donot_update_deleted_file_by_default(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid old_id, new_id; git_commit *old_commit = NULL, *new_commit = NULL; git_index *index = NULL; @@ -622,7 +622,7 @@ static int checkout_cancel_cb( void test_checkout_tree__can_cancel_checkout_from_notify(void) { struct checkout_cancel_at ca; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid oid; git_object *obj = NULL; @@ -674,7 +674,7 @@ void test_checkout_tree__can_cancel_checkout_from_notify(void) void test_checkout_tree__can_checkout_with_last_workdir_item_missing(void) { git_index *index = NULL; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid tree_id, commit_id; git_tree *tree = NULL; git_commit *commit = NULL; @@ -710,7 +710,7 @@ void test_checkout_tree__can_checkout_with_last_workdir_item_missing(void) void test_checkout_tree__issue_1397(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; const char *partial_oid = "8a7ef04"; git_object *tree = NULL; @@ -733,7 +733,7 @@ void test_checkout_tree__issue_1397(void) void test_checkout_tree__can_write_to_empty_dirs(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid oid; git_object *obj = NULL; @@ -759,7 +759,7 @@ void test_checkout_tree__can_write_to_empty_dirs(void) void test_checkout_tree__fails_when_dir_in_use(void) { #ifdef GIT_WIN32 - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid oid; git_object *obj = NULL; @@ -792,7 +792,7 @@ void test_checkout_tree__fails_when_dir_in_use(void) void test_checkout_tree__can_continue_when_dir_in_use(void) { #ifdef GIT_WIN32 - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid oid; git_object *obj = NULL; @@ -825,7 +825,7 @@ void test_checkout_tree__can_continue_when_dir_in_use(void) void test_checkout_tree__target_directory_from_bare(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid oid; checkout_counts cts; memset(&cts, 0, sizeof(cts)); @@ -910,7 +910,7 @@ static void create_conflict(void) void test_checkout_tree__fails_when_conflicts_exist_in_index(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_oid oid; git_object *obj = NULL; @@ -930,7 +930,7 @@ void test_checkout_tree__filemode_preserved_in_index(void) { git_oid executable_oid; git_commit *commit; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_index *index; const git_index_entry *entry; diff --git a/tests/checkout/typechange.c b/tests/checkout/typechange.c index d88864cf3..7aa14b36d 100644 --- a/tests/checkout/typechange.c +++ b/tests/checkout/typechange.c @@ -107,7 +107,7 @@ void test_checkout_typechange__checkout_typechanges_safe(void) { int i; git_object *obj; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; for (i = 0; g_typechange_oids[i] != NULL; ++i) { cl_git_pass(git_revparse_single(&obj, g_repo, g_typechange_oids[i])); @@ -194,7 +194,7 @@ void test_checkout_typechange__checkout_with_conflicts(void) { int i; git_object *obj; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; notify_counts cts = {0}; opts.notify_flags = diff --git a/tests/clone/nonetwork.c b/tests/clone/nonetwork.c index f00d28b7a..68a277448 100644 --- a/tests/clone/nonetwork.c +++ b/tests/clone/nonetwork.c @@ -14,7 +14,7 @@ static git_remote* g_remote; void test_clone_nonetwork__initialize(void) { - git_checkout_opts dummy_opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options dummy_opts = GIT_CHECKOUT_OPTIONS_INIT; git_remote_callbacks dummy_callbacks = GIT_REMOTE_CALLBACKS_INIT; g_repo = NULL; diff --git a/tests/diff/rename.c b/tests/diff/rename.c index ca08d15f3..4bc3eb54c 100644 --- a/tests/diff/rename.c +++ b/tests/diff/rename.c @@ -929,7 +929,7 @@ void test_diff_rename__rejected_match_can_match_others(void) git_reference *head, *selfsimilar; git_index *index; git_tree *tree; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_diff *diff; git_diff_options diffopts = GIT_DIFF_OPTIONS_INIT; git_diff_find_options findopts = GIT_DIFF_FIND_OPTIONS_INIT; @@ -1016,7 +1016,7 @@ void test_diff_rename__rejected_match_can_match_others_two(void) git_reference *head, *selfsimilar; git_index *index; git_tree *tree; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_diff *diff; git_diff_options diffopts = GIT_DIFF_OPTIONS_INIT; git_diff_find_options findopts = GIT_DIFF_FIND_OPTIONS_INIT; @@ -1072,7 +1072,7 @@ void test_diff_rename__rejected_match_can_match_others_three(void) git_reference *head, *selfsimilar; git_index *index; git_tree *tree; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; git_diff *diff; git_diff_options diffopts = GIT_DIFF_OPTIONS_INIT; git_diff_find_options findopts = GIT_DIFF_FIND_OPTIONS_INIT; diff --git a/tests/index/names.c b/tests/index/names.c index 4723449d9..52922e9f1 100644 --- a/tests/index/names.c +++ b/tests/index/names.c @@ -112,7 +112,7 @@ void test_index_names__cleaned_on_checkout_tree(void) { git_oid oid; git_object *obj; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_UPDATE_ONLY; @@ -127,7 +127,7 @@ void test_index_names__cleaned_on_checkout_tree(void) void test_index_names__cleaned_on_checkout_head(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_UPDATE_ONLY; @@ -138,7 +138,7 @@ void test_index_names__cleaned_on_checkout_head(void) void test_index_names__retained_on_checkout_index(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_UPDATE_ONLY; diff --git a/tests/index/reuc.c b/tests/index/reuc.c index bf051c827..27240a30f 100644 --- a/tests/index/reuc.c +++ b/tests/index/reuc.c @@ -336,7 +336,7 @@ void test_index_reuc__cleaned_on_checkout_tree(void) { git_oid oid; git_object *obj; - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_UPDATE_ONLY; @@ -351,7 +351,7 @@ void test_index_reuc__cleaned_on_checkout_tree(void) void test_index_reuc__cleaned_on_checkout_head(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_UPDATE_ONLY; @@ -362,7 +362,7 @@ void test_index_reuc__cleaned_on_checkout_head(void) void test_index_reuc__retained_on_checkout_index(void) { - git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_UPDATE_ONLY; diff --git a/tests/merge/merge_helpers.c b/tests/merge/merge_helpers.c index 8d6ef2dbe..14a30b288 100644 --- a/tests/merge/merge_helpers.c +++ b/tests/merge/merge_helpers.c @@ -83,7 +83,7 @@ int merge_branches(git_merge_result **result, git_repository *repo, const char * { git_reference *head_ref, *theirs_ref; git_merge_head *theirs_head; - git_checkout_opts head_checkout_opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options head_checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; head_checkout_opts.checkout_strategy = GIT_CHECKOUT_FORCE; diff --git a/tests/merge/workdir/trivial.c b/tests/merge/workdir/trivial.c index a6bbbf095..8b0d32894 100644 --- a/tests/merge/workdir/trivial.c +++ b/tests/merge/workdir/trivial.c @@ -31,7 +31,7 @@ void test_merge_workdir_trivial__cleanup(void) static int merge_trivial(const char *ours, const char *theirs) { git_buf branch_buf = GIT_BUF_INIT; - git_checkout_opts checkout_opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_reference *our_ref, *their_ref; git_merge_head *their_heads[1]; git_merge_opts opts = GIT_MERGE_OPTS_INIT; diff --git a/tests/online/clone.c b/tests/online/clone.c index fa2408a75..9919e8b06 100644 --- a/tests/online/clone.c +++ b/tests/online/clone.c @@ -18,7 +18,7 @@ static git_clone_options g_options; void test_online_clone__initialize(void) { - git_checkout_opts dummy_opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options dummy_opts = GIT_CHECKOUT_OPTIONS_INIT; git_remote_callbacks dummy_callbacks = GIT_REMOTE_CALLBACKS_INIT; g_repo = NULL; @@ -130,7 +130,7 @@ void test_online_clone__clone_into(void) git_buf path = GIT_BUF_INIT; git_remote *remote; git_reference *head; - git_checkout_opts checkout_opts = GIT_CHECKOUT_OPTS_INIT; + git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; bool checkout_progress_cb_was_called = false, diff --git a/tests/structinit/structinit.c b/tests/structinit/structinit.c index ce425be41..ec4f43999 100644 --- a/tests/structinit/structinit.c +++ b/tests/structinit/structinit.c @@ -47,8 +47,8 @@ void test_structinit_structinit__compare(void) /* checkout */ CHECK_MACRO_FUNC_INIT_EQUAL( \ - git_checkout_opts, GIT_CHECKOUT_OPTS_VERSION, \ - GIT_CHECKOUT_OPTS_INIT, git_checkout_init_opts); + git_checkout_options, GIT_CHECKOUT_OPTIONS_VERSION, \ + GIT_CHECKOUT_OPTIONS_INIT, git_checkout_init_opts); /* clone */ CHECK_MACRO_FUNC_INIT_EQUAL( \