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
0267c34c
Commit
0267c34c
authored
Sep 25, 2015
by
Edward Thomson
Committed by
Edward Thomson
May 26, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patch application: drop unnecessary `patch_image_init`
parent
4117a235
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
10 deletions
+2
-10
src/apply.c
+2
-10
No files found.
src/apply.c
View file @
0267c34c
...
...
@@ -38,11 +38,7 @@ static void patch_line_init(
out
->
content_offset
=
in_offset
;
}
static
unsigned
int
patch_image_init
(
patch_image
*
out
)
{
memset
(
out
,
0x0
,
sizeof
(
patch_image
));
return
0
;
}
#define PATCH_IMAGE_INIT { {0} }
static
int
patch_image_init_fromstr
(
patch_image
*
out
,
const
char
*
in
,
size_t
in_len
)
...
...
@@ -165,14 +161,10 @@ static int apply_hunk(
git_patch
*
patch
,
git_patch_hunk
*
hunk
)
{
patch_image
preimage
,
postimage
;
patch_image
preimage
=
PATCH_IMAGE_INIT
,
postimage
=
PATCH_IMAGE_INIT
;
size_t
line_num
,
i
;
int
error
=
0
;
if
((
error
=
patch_image_init
(
&
preimage
))
<
0
||
(
error
=
patch_image_init
(
&
postimage
))
<
0
)
goto
done
;
for
(
i
=
0
;
i
<
hunk
->
line_count
;
i
++
)
{
size_t
linenum
=
hunk
->
line_start
+
i
;
git_diff_line
*
line
=
git_array_get
(
patch
->
lines
,
linenum
);
...
...
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