Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
a5df71c1
Commit
a5df71c1
authored
Apr 19, 2013
by
Linquize
Committed by
Russell Belfer
Apr 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support diff.context config
parent
bd0a07f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
+12
-1
src/diff.c
+12
-1
No files found.
src/diff.c
View file @
a5df71c1
...
...
@@ -267,6 +267,16 @@ static int config_bool(git_config *cfg, const char *name, int defvalue)
return
val
;
}
static
int
config_int
(
git_config
*
cfg
,
const
char
*
name
,
int
defvalue
)
{
int
val
=
defvalue
;
if
(
git_config_get_int32
(
&
val
,
cfg
,
name
)
<
0
)
giterr_clear
();
return
val
;
}
static
git_diff_list
*
git_diff_list_alloc
(
git_repository
*
repo
,
const
git_diff_options
*
opts
)
{
...
...
@@ -306,7 +316,8 @@ static git_diff_list *git_diff_list_alloc(
if
(
opts
==
NULL
)
{
/* Make sure we default to 3 lines */
diff
->
opts
.
context_lines
=
3
;
int
context
=
config_int
(
cfg
,
"diff.context"
,
3
);
diff
->
opts
.
context_lines
=
max
(
context
,
0
);
return
diff
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment