summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-04-29 14:30:15 -0700
committerRussell Belfer <rb@github.com>2014-04-29 14:30:15 -0700
commit9dff068ae157db37ef649d33f0a07514541dd04b (patch)
tree6f8db905d7112cb1d561bc9657b1141e081998e3
parent6f52f1ef44522fec73be3920563a1619c97543c3 (diff)
downloadlibgit2-9dff068ae157db37ef649d33f0a07514541dd04b.tar.gz
Get rid of redundant git_diff_options_init fn
Since git_diff_init_options was introduced, remove this old fn.
-rw-r--r--include/git2/diff.h17
-rw-r--r--src/diff.c14
-rw-r--r--tests/diff/blob.c2
-rw-r--r--tests/diff/tree.c2
4 files changed, 2 insertions, 33 deletions
diff --git a/include/git2/diff.h b/include/git2/diff.h
index afdb2c981..18880889c 100644
--- a/include/git2/diff.h
+++ b/include/git2/diff.h
@@ -811,23 +811,6 @@ GIT_EXTERN(int) git_diff_find_similar(
git_diff *diff,
const git_diff_find_options *options);
-/**
- * Initialize diff options structure
- *
- * In most cases, you can probably just use `GIT_DIFF_OPTIONS_INIT` to
- * initialize the diff options structure, but in some cases that is not
- * going to work. You can call this function instead. Note that you
- * must pass both a pointer to the structure to be initialized and the
- * `GIT_DIFF_OPTIONS_VERSION` value from the header you compiled with.
- *
- * @param options Pointer to git_diff_options memory to be initialized
- * @param version Should be `GIT_DIFF_OPTIONS_VERSION`
- * @return 0 on success, negative on failure (such as unsupported version)
- */
-GIT_EXTERN(int) git_diff_options_init(
- git_diff_options *options,
- unsigned int version);
-
/**@}*/
diff --git a/src/diff.c b/src/diff.c
index 5a6b127a1..b34d15312 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -1282,20 +1282,6 @@ int git_diff_tree_to_workdir_with_index(
return error;
}
-int git_diff_options_init(git_diff_options *options, unsigned int version)
-{
- git_diff_options template = GIT_DIFF_OPTIONS_INIT;
-
- if (version != template.version) {
- giterr_set(GITERR_INVALID,
- "Invalid version %d for git_diff_options", (int)version);
- return -1;
- }
-
- memcpy(options, &template, sizeof(*options));
- return 0;
-}
-
size_t git_diff_num_deltas(const git_diff *diff)
{
assert(diff);
diff --git a/tests/diff/blob.c b/tests/diff/blob.c
index d1fff9c5b..527007965 100644
--- a/tests/diff/blob.c
+++ b/tests/diff/blob.c
@@ -26,7 +26,7 @@ void test_diff_blob__initialize(void)
g_repo = cl_git_sandbox_init("attr");
- cl_git_pass(git_diff_options_init(&opts, GIT_DIFF_OPTIONS_VERSION));
+ cl_git_pass(git_diff_init_options(&opts, GIT_DIFF_OPTIONS_VERSION));
opts.context_lines = 1;
memset(&expected, 0, sizeof(expected));
diff --git a/tests/diff/tree.c b/tests/diff/tree.c
index 582174b8b..6ab49fdb0 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_options_init(&opts, GIT_DIFF_OPTIONS_VERSION));
+ cl_git_pass(git_diff_init_options(&opts, GIT_DIFF_OPTIONS_VERSION));
memset(&expect, 0, sizeof(expect));