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
7a28f268
Commit
7a28f268
authored
Apr 10, 2014
by
Jacques Germishuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix const-correctness of git_patch_get_delta, git_patch_num_hunks, git_patch_num_lines_in_hunk
parent
51297cad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
include/git2/patch.h
+3
-3
src/diff_patch.c
+3
-3
No files found.
include/git2/patch.h
View file @
7a28f268
...
...
@@ -141,12 +141,12 @@ GIT_EXTERN(void) git_patch_free(git_patch *patch);
/**
* Get the delta associated with a patch
*/
GIT_EXTERN
(
const
git_diff_delta
*
)
git_patch_get_delta
(
git_patch
*
patch
);
GIT_EXTERN
(
const
git_diff_delta
*
)
git_patch_get_delta
(
const
git_patch
*
patch
);
/**
* Get the number of hunks in a patch
*/
GIT_EXTERN
(
size_t
)
git_patch_num_hunks
(
git_patch
*
patch
);
GIT_EXTERN
(
size_t
)
git_patch_num_hunks
(
const
git_patch
*
patch
);
/**
* Get line counts of each type in a patch.
...
...
@@ -197,7 +197,7 @@ GIT_EXTERN(int) git_patch_get_hunk(
* @return Number of lines in hunk or -1 if invalid hunk index
*/
GIT_EXTERN
(
int
)
git_patch_num_lines_in_hunk
(
git_patch
*
patch
,
const
git_patch
*
patch
,
size_t
hunk_idx
);
/**
...
...
src/diff_patch.c
View file @
7a28f268
...
...
@@ -631,13 +631,13 @@ void git_patch_free(git_patch *patch)
GIT_REFCOUNT_DEC
(
patch
,
diff_patch_free
);
}
const
git_diff_delta
*
git_patch_get_delta
(
git_patch
*
patch
)
const
git_diff_delta
*
git_patch_get_delta
(
const
git_patch
*
patch
)
{
assert
(
patch
);
return
patch
->
delta
;
}
size_t
git_patch_num_hunks
(
git_patch
*
patch
)
size_t
git_patch_num_hunks
(
const
git_patch
*
patch
)
{
assert
(
patch
);
return
git_array_size
(
patch
->
hunks
);
...
...
@@ -708,7 +708,7 @@ int git_patch_get_hunk(
return
0
;
}
int
git_patch_num_lines_in_hunk
(
git_patch
*
patch
,
size_t
hunk_idx
)
int
git_patch_num_lines_in_hunk
(
const
git_patch
*
patch
,
size_t
hunk_idx
)
{
diff_patch_hunk
*
hunk
;
assert
(
patch
);
...
...
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