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
d88766c4
Commit
d88766c4
authored
Oct 26, 2014
by
Pierre-Olivier Latour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed context_lines and interhunk_lines to uint32_t to match struct s_xdemitconf
parent
116a19d4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
CHANGELOG.md
+5
-0
include/git2/diff.h
+2
-2
src/diff.c
+1
-1
No files found.
CHANGELOG.md
View file @
d88766c4
...
@@ -107,3 +107,8 @@ v0.21 + 1
...
@@ -107,3 +107,8 @@ v0.21 + 1
*
The THREADSAFE option to build libgit2 with threading support has
*
The THREADSAFE option to build libgit2 with threading support has
been flipped to be on by default.
been flipped to be on by default.
*
The context_lines and interhunk_lines fields in git_diff_options are
now uint32_t instead of uint16_t. This allows to set them to UINT_MAX,
in effect asking for "infinite" context e.g. to iterate over all the
unmodified lines of a diff.
include/git2/diff.h
View file @
d88766c4
...
@@ -377,8 +377,8 @@ typedef struct {
...
@@ -377,8 +377,8 @@ typedef struct {
/* options controlling how to diff text is generated */
/* options controlling how to diff text is generated */
uint
16
_t
context_lines
;
/**< defaults to 3 */
uint
32
_t
context_lines
;
/**< defaults to 3 */
uint
16
_t
interhunk_lines
;
/**< defaults to 0 */
uint
32
_t
interhunk_lines
;
/**< defaults to 0 */
uint16_t
id_abbrev
;
/**< default 'core.abbrev' or 7 if unset */
uint16_t
id_abbrev
;
/**< default 'core.abbrev' or 7 if unset */
git_off_t
max_size
;
/**< defaults to 512MB */
git_off_t
max_size
;
/**< defaults to 512MB */
const
char
*
old_prefix
;
/**< defaults to "a" */
const
char
*
old_prefix
;
/**< defaults to "a" */
...
...
src/diff.c
View file @
d88766c4
...
@@ -439,7 +439,7 @@ static int diff_list_apply_options(
...
@@ -439,7 +439,7 @@ static int diff_list_apply_options(
/* If not given explicit `opts`, check `diff.xyz` configs */
/* If not given explicit `opts`, check `diff.xyz` configs */
if
(
!
opts
)
{
if
(
!
opts
)
{
int
context
=
git_config__get_int_force
(
cfg
,
"diff.context"
,
3
);
int
context
=
git_config__get_int_force
(
cfg
,
"diff.context"
,
3
);
diff
->
opts
.
context_lines
=
context
>=
0
?
(
uint
16
_t
)
context
:
3
;
diff
->
opts
.
context_lines
=
context
>=
0
?
(
uint
32
_t
)
context
:
3
;
/* add other defaults here */
/* add other defaults here */
}
}
...
...
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