diff options
| author | Russell Belfer <rb@github.com> | 2013-11-01 10:18:03 -0700 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2013-11-01 10:20:51 -0700 |
| commit | a5c16f3cfb92f1129ef13124fc70147480141d69 (patch) | |
| tree | 1f5e321b95d45d4808e61514d2aac353e2a46fb5 /tests-clar | |
| parent | 8e5a8ef86f1d528472884f737612083abda86e17 (diff) | |
| download | libgit2-a5c16f3cfb92f1129ef13124fc70147480141d69.tar.gz | |
Add git_diff_options_init helper
Sometimes the static initializer for git_diff_options cannot be
used and since setting them to all zeroes doesn't actually work
quite right, this adds a new helper for that situation.
This also adds an explicit new value to the submodule settings
options to be used when those enums need static initialization.
Diffstat (limited to 'tests-clar')
| -rw-r--r-- | tests-clar/diff/blob.c | 3 | ||||
| -rw-r--r-- | tests-clar/diff/tree.c | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/tests-clar/diff/blob.c b/tests-clar/diff/blob.c index b51bc0f38..93f20711c 100644 --- a/tests-clar/diff/blob.c +++ b/tests-clar/diff/blob.c @@ -26,9 +26,8 @@ void test_diff_blob__initialize(void) g_repo = cl_git_sandbox_init("attr"); - GIT_INIT_STRUCTURE(&opts, GIT_DIFF_OPTIONS_VERSION); + cl_git_pass(git_diff_options_init(&opts, GIT_DIFF_OPTIONS_VERSION)); opts.context_lines = 1; - opts.interhunk_lines = 0; memset(&expected, 0, sizeof(expected)); diff --git a/tests-clar/diff/tree.c b/tests-clar/diff/tree.c index ca2daf5fb..582174b8b 100644 --- a/tests-clar/diff/tree.c +++ b/tests-clar/diff/tree.c @@ -9,9 +9,7 @@ static diff_expects expect; void test_diff_tree__initialize(void) { - GIT_INIT_STRUCTURE(&opts, GIT_DIFF_OPTIONS_VERSION); - /* The default context lines is set by _INIT which we can't use here */ - opts.context_lines = 3; + cl_git_pass(git_diff_options_init(&opts, GIT_DIFF_OPTIONS_VERSION)); memset(&expect, 0, sizeof(expect)); @@ -91,7 +89,8 @@ void test_diff_tree__0(void) } #define DIFF_OPTS(FLAGS, CTXT) \ - {GIT_DIFF_OPTIONS_VERSION, (FLAGS), 0, {NULL,0}, NULL, NULL, (CTXT), 1} + {GIT_DIFF_OPTIONS_VERSION, (FLAGS), GIT_SUBMODULE_IGNORE_DEFAULT, \ + {NULL,0}, NULL, NULL, (CTXT), 1} void test_diff_tree__options(void) { |
