summaryrefslogtreecommitdiff
path: root/tests-clar/diff/tree.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-11-01 10:18:03 -0700
committerRussell Belfer <rb@github.com>2013-11-01 10:20:51 -0700
commita5c16f3cfb92f1129ef13124fc70147480141d69 (patch)
tree1f5e321b95d45d4808e61514d2aac353e2a46fb5 /tests-clar/diff/tree.c
parent8e5a8ef86f1d528472884f737612083abda86e17 (diff)
downloadlibgit2-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/diff/tree.c')
-rw-r--r--tests-clar/diff/tree.c7
1 files changed, 3 insertions, 4 deletions
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)
{