From 1aa5318a9ec4f0ec16518d1102b29e5ba94a801a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Sat, 9 Mar 2013 16:04:34 +0100 Subject: diff: allow asking for diffs with no context Previously, 0 meant default. This is problematic, as asking for 0 context lines is a valid thing to do. Change GIT_DIFF_OPTIONS_INIT to default to three and stop treating 0 as a magic value. In case no options are provided, make sure the options in the diff object default to 3. --- tests-clar/diff/tree.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests-clar/diff/tree.c') diff --git a/tests-clar/diff/tree.c b/tests-clar/diff/tree.c index 902531530..e86f8d538 100644 --- a/tests-clar/diff/tree.c +++ b/tests-clar/diff/tree.c @@ -10,6 +10,8 @@ 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; memset(&expect, 0, sizeof(expect)); -- cgit v1.2.1