summaryrefslogtreecommitdiff
path: root/src/diff.c
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 /src/diff.c
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 'src/diff.c')
-rw-r--r--src/diff.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/diff.c b/src/diff.c
index d2e129d1b..6c2592137 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -350,14 +350,19 @@ int git_diff_commit_as_email(
return error;
}
-int git_diff_init_options(git_diff_options *opts, unsigned int version)
+int git_diff_options_init(git_diff_options *opts, unsigned int version)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE(
opts, version, git_diff_options, GIT_DIFF_OPTIONS_INIT);
return 0;
}
-int git_diff_find_init_options(
+int git_diff_init_options(git_diff_options *opts, unsigned int version)
+{
+ return git_diff_options_init(opts, version);
+}
+
+int git_diff_find_options_init(
git_diff_find_options *opts, unsigned int version)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE(
@@ -365,7 +370,13 @@ int git_diff_find_init_options(
return 0;
}
-int git_diff_format_email_init_options(
+int git_diff_find_init_options(
+ git_diff_find_options *opts, unsigned int version)
+{
+ return git_diff_find_options_init(opts, version);
+}
+
+int git_diff_format_email_options_init(
git_diff_format_email_options *opts, unsigned int version)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE(
@@ -374,6 +385,12 @@ int git_diff_format_email_init_options(
return 0;
}
+int git_diff_format_email_init_options(
+ git_diff_format_email_options *opts, unsigned int version)
+{
+ return git_diff_format_email_options_init(opts, version);
+}
+
static int flush_hunk(git_oid *result, git_hash_ctx *ctx)
{
git_oid hash;
@@ -481,7 +498,7 @@ out:
return error;
}
-int git_diff_patchid_init_options(git_diff_patchid_options *opts, unsigned int version)
+int git_diff_patchid_options_init(git_diff_patchid_options *opts, unsigned int version)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE(
opts, version, git_diff_patchid_options, GIT_DIFF_PATCHID_OPTIONS_INIT);