summaryrefslogtreecommitdiff
path: root/src/diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/diff.c b/src/diff.c
index 0861b13eb..ca08f4233 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -291,8 +291,11 @@ static git_diff_list *git_diff_list_alloc(
* - diff.noprefix
*/
- if (opts == NULL)
+ if (opts == NULL) {
+ /* Make sure we default to 3 lines */
+ diff->opts.context_lines = 3;
return diff;
+ }
memcpy(&diff->opts, opts, sizeof(git_diff_options));