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
d1b6ea8a
Commit
d1b6ea8a
authored
Dec 01, 2012
by
David Michael Barr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delta-apply: add git__delta_read_header
parent
f1e5c506
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
src/delta-apply.c
+13
-0
src/delta-apply.h
+17
-0
No files found.
src/delta-apply.c
View file @
d1b6ea8a
...
...
@@ -36,6 +36,19 @@ static int hdr_sz(
return
0
;
}
int
git__delta_read_header
(
const
unsigned
char
*
delta
,
size_t
delta_len
,
size_t
*
base_sz
,
size_t
*
res_sz
)
{
const
unsigned
char
*
delta_end
=
delta
+
delta_len
;
if
((
hdr_sz
(
base_sz
,
&
delta
,
delta_end
)
<
0
)
||
(
hdr_sz
(
res_sz
,
&
delta
,
delta_end
)
<
0
))
return
-
1
;
return
0
;
}
int
git__delta_apply
(
git_rawobj
*
out
,
const
unsigned
char
*
base
,
...
...
src/delta-apply.h
View file @
d1b6ea8a
...
...
@@ -30,4 +30,21 @@ extern int git__delta_apply(
const
unsigned
char
*
delta
,
size_t
delta_len
);
/**
* Read the header of a git binary delta.
*
* @param delta the delta to execute copy/insert instructions from.
* @param delta_len total number of bytes in the delta.
* @param base_sz pointer to store the base size field.
* @param res_sz pointer to store the result size field.
* @return
* - 0 on a successful decoding the header.
* - GIT_ERROR if the delta is corrupt.
*/
extern
int
git__delta_read_header
(
const
unsigned
char
*
delta
,
size_t
delta_len
,
size_t
*
base_sz
,
size_t
*
res_sz
);
#endif
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