summaryrefslogtreecommitdiff
path: root/src/diff.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-03-09 08:09:17 -0800
committerRussell Belfer <rb@github.com>2013-03-09 08:09:17 -0800
commit57e765b2e828db07bf474897985f1d7e6e47bd79 (patch)
treef4c255cfa982becd1392608c1b60ea7c8b15fe97 /src/diff.c
parent0887b580bfe83a9f6e9a8530368a22e478411a0f (diff)
parent1aa5318a9ec4f0ec16518d1102b29e5ba94a801a (diff)
downloadlibgit2-57e765b2e828db07bf474897985f1d7e6e47bd79.tar.gz
Merge pull request #1175 from carlosmn/diff-0-ctx
Can't perform diff with no context lines
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));