summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-06-06 16:36:23 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2019-06-14 09:57:00 +0100
commit0b5ba0d744e69da5dc8c08d167c83dd87ed83af2 (patch)
tree0dcca647cc9d9fe8080c2b0ea483dff5d74ee566 /tests
parenta5ddae68f86b459ce53319c8af1e7b1ea7d21dd6 (diff)
downloadlibgit2-0b5ba0d744e69da5dc8c08d167c83dd87ed83af2.tar.gz
Rename opt init functions to `options_init`
In libgit2 nomenclature, when we need to verb a direct object, we name a function `git_directobject_verb`. Thus, if we need to init an options structure named `git_foo_options`, then the name of the function that does that should be `git_foo_options_init`. The previous names of `git_foo_init_options` is close - it _sounds_ as if it's initializing the options of a `foo`, but in fact `git_foo_options` is its own noun that should be respected. Deprecate the old names; they'll now call directly to the new ones.
Diffstat (limited to 'tests')
-rw-r--r--tests/checkout/icase.c2
-rw-r--r--tests/core/structinit.c32
-rw-r--r--tests/diff/blob.c2
-rw-r--r--tests/diff/patch.c2
-rw-r--r--tests/diff/tree.c4
5 files changed, 21 insertions, 21 deletions
diff --git a/tests/checkout/icase.c b/tests/checkout/icase.c
index e6c640ef5..b444878c3 100644
--- a/tests/checkout/icase.c
+++ b/tests/checkout/icase.c
@@ -33,7 +33,7 @@ void test_checkout_icase__initialize(void)
cl_git_pass(git_reference_name_to_id(&id, repo, "refs/heads/dir"));
cl_git_pass(git_object_lookup(&obj, repo, &id, GIT_OBJECT_ANY));
- git_checkout_init_options(&checkout_opts, GIT_CHECKOUT_OPTIONS_VERSION);
+ git_checkout_options_init(&checkout_opts, GIT_CHECKOUT_OPTIONS_VERSION);
checkout_opts.checkout_strategy = GIT_CHECKOUT_NONE;
}
diff --git a/tests/core/structinit.c b/tests/core/structinit.c
index 8feba864e..82286a210 100644
--- a/tests/core/structinit.c
+++ b/tests/core/structinit.c
@@ -75,27 +75,27 @@ void test_core_structinit__compare(void)
/* blame */
CHECK_MACRO_FUNC_INIT_EQUAL( \
git_blame_options, GIT_BLAME_OPTIONS_VERSION, \
- GIT_BLAME_OPTIONS_INIT, git_blame_init_options);
+ GIT_BLAME_OPTIONS_INIT, git_blame_options_init);
/* checkout */
CHECK_MACRO_FUNC_INIT_EQUAL( \
git_checkout_options, GIT_CHECKOUT_OPTIONS_VERSION, \
- GIT_CHECKOUT_OPTIONS_INIT, git_checkout_init_options);
+ GIT_CHECKOUT_OPTIONS_INIT, git_checkout_options_init);
/* clone */
CHECK_MACRO_FUNC_INIT_EQUAL( \
git_clone_options, GIT_CLONE_OPTIONS_VERSION, \
- GIT_CLONE_OPTIONS_INIT, git_clone_init_options);
+ GIT_CLONE_OPTIONS_INIT, git_clone_options_init);
/* diff */
CHECK_MACRO_FUNC_INIT_EQUAL( \
git_diff_options, GIT_DIFF_OPTIONS_VERSION, \
- GIT_DIFF_OPTIONS_INIT, git_diff_init_options);
+ GIT_DIFF_OPTIONS_INIT, git_diff_options_init);
/* diff_find */
CHECK_MACRO_FUNC_INIT_EQUAL( \
git_diff_find_options, GIT_DIFF_FIND_OPTIONS_VERSION, \
- GIT_DIFF_FIND_OPTIONS_INIT, git_diff_find_init_options);
+ GIT_DIFF_FIND_OPTIONS_INIT, git_diff_find_options_init);
/* filter */
CHECK_MACRO_FUNC_INIT_EQUAL( \
@@ -105,22 +105,22 @@ void test_core_structinit__compare(void)
/* merge_file_input */
CHECK_MACRO_FUNC_INIT_EQUAL( \
git_merge_file_input, GIT_MERGE_FILE_INPUT_VERSION, \
- GIT_MERGE_FILE_INPUT_INIT, git_merge_file_init_input);
+ GIT_MERGE_FILE_INPUT_INIT, git_merge_file_input_init);
/* merge_file */
CHECK_MACRO_FUNC_INIT_EQUAL( \
git_merge_file_options, GIT_MERGE_FILE_OPTIONS_VERSION, \
- GIT_MERGE_FILE_OPTIONS_INIT, git_merge_file_init_options);
+ GIT_MERGE_FILE_OPTIONS_INIT, git_merge_file_options_init);
/* merge_tree */
CHECK_MACRO_FUNC_INIT_EQUAL( \
git_merge_options, GIT_MERGE_OPTIONS_VERSION, \
- GIT_MERGE_OPTIONS_INIT, git_merge_init_options);
+ GIT_MERGE_OPTIONS_INIT, git_merge_options_init);
/* push */
CHECK_MACRO_FUNC_INIT_EQUAL( \
git_push_options, GIT_PUSH_OPTIONS_VERSION, \
- GIT_PUSH_OPTIONS_INIT, git_push_init_options);
+ GIT_PUSH_OPTIONS_INIT, git_push_options_init);
/* remote */
CHECK_MACRO_FUNC_INIT_EQUAL( \
@@ -130,22 +130,22 @@ void test_core_structinit__compare(void)
/* repository_init */
CHECK_MACRO_FUNC_INIT_EQUAL( \
git_repository_init_options, GIT_REPOSITORY_INIT_OPTIONS_VERSION, \
- GIT_REPOSITORY_INIT_OPTIONS_INIT, git_repository_init_init_options);
+ GIT_REPOSITORY_INIT_OPTIONS_INIT, git_repository_init_options_init);
/* revert */
CHECK_MACRO_FUNC_INIT_EQUAL( \
git_revert_options, GIT_REVERT_OPTIONS_VERSION, \
- GIT_REVERT_OPTIONS_INIT, git_revert_init_options);
+ GIT_REVERT_OPTIONS_INIT, git_revert_options_init);
/* stash apply */
CHECK_MACRO_FUNC_INIT_EQUAL( \
git_stash_apply_options, GIT_STASH_APPLY_OPTIONS_VERSION, \
- GIT_STASH_APPLY_OPTIONS_INIT, git_stash_apply_init_options);
+ GIT_STASH_APPLY_OPTIONS_INIT, git_stash_apply_options_init);
/* status */
CHECK_MACRO_FUNC_INIT_EQUAL( \
git_status_options, GIT_STATUS_OPTIONS_VERSION, \
- GIT_STATUS_OPTIONS_INIT, git_status_init_options);
+ GIT_STATUS_OPTIONS_INIT, git_status_options_init);
/* transport */
CHECK_MACRO_FUNC_INIT_EQUAL( \
@@ -170,14 +170,14 @@ void test_core_structinit__compare(void)
/* submodule update */
CHECK_MACRO_FUNC_INIT_EQUAL( \
git_submodule_update_options, GIT_SUBMODULE_UPDATE_OPTIONS_VERSION, \
- GIT_SUBMODULE_UPDATE_OPTIONS_INIT, git_submodule_update_init_options);
+ GIT_SUBMODULE_UPDATE_OPTIONS_INIT, git_submodule_update_options_init);
/* submodule update */
CHECK_MACRO_FUNC_INIT_EQUAL( \
git_proxy_options, GIT_PROXY_OPTIONS_VERSION, \
- GIT_PROXY_OPTIONS_INIT, git_proxy_init_options);
+ GIT_PROXY_OPTIONS_INIT, git_proxy_options_init);
CHECK_MACRO_FUNC_INIT_EQUAL( \
git_diff_patchid_options, GIT_DIFF_PATCHID_OPTIONS_VERSION, \
- GIT_DIFF_PATCHID_OPTIONS_INIT, git_diff_patchid_init_options);
+ GIT_DIFF_PATCHID_OPTIONS_INIT, git_diff_patchid_options_init);
}
diff --git a/tests/diff/blob.c b/tests/diff/blob.c
index 37898adcf..bebe6db27 100644
--- a/tests/diff/blob.c
+++ b/tests/diff/blob.c
@@ -39,7 +39,7 @@ void test_diff_blob__initialize(void)
g_repo = cl_git_sandbox_init("attr");
- cl_git_pass(git_diff_init_options(&opts, GIT_DIFF_OPTIONS_VERSION));
+ cl_git_pass(git_diff_options_init(&opts, GIT_DIFF_OPTIONS_VERSION));
opts.context_lines = 1;
memset(&expected, 0, sizeof(expected));
diff --git a/tests/diff/patch.c b/tests/diff/patch.c
index bc7976fe0..7eb353627 100644
--- a/tests/diff/patch.c
+++ b/tests/diff/patch.c
@@ -692,7 +692,7 @@ void test_diff_patch__can_strip_bad_utf8(void)
git_patch *patch;
git_buf buf = GIT_BUF_INIT;
- cl_git_pass(git_diff_init_options(&opts, GIT_DIFF_OPTIONS_VERSION));
+ cl_git_pass(git_diff_options_init(&opts, GIT_DIFF_OPTIONS_VERSION));
cl_git_pass(git_patch_from_buffers(&patch, a, strlen(a), NULL, b, strlen(b), NULL, &opts));
cl_git_pass(git_patch_to_buf(&buf, patch));
diff --git a/tests/diff/tree.c b/tests/diff/tree.c
index a3b00ec08..2359a834b 100644
--- a/tests/diff/tree.c
+++ b/tests/diff/tree.c
@@ -9,7 +9,7 @@ static diff_expects expect;
void test_diff_tree__initialize(void)
{
- cl_git_pass(git_diff_init_options(&opts, GIT_DIFF_OPTIONS_VERSION));
+ cl_git_pass(git_diff_options_init(&opts, GIT_DIFF_OPTIONS_VERSION));
memset(&expect, 0, sizeof(expect));
@@ -472,7 +472,7 @@ void test_diff_tree__diff_configs(void)
cl_git_pass(git_diff_tree_to_tree(&diff, g_repo, a, b, NULL));
- cl_git_pass(git_diff_foreach(diff,
+ cl_git_pass(git_diff_foreach(diff,
diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &expect));
cl_assert_equal_i(2, expect.files);