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
1cb5a811
Commit
1cb5a811
authored
Jan 26, 2014
by
XTao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix write_object.
parent
ca55fc63
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
src/pack-objects.c
+5
-3
src/zstream.c
+1
-2
No files found.
src/pack-objects.c
View file @
1cb5a811
...
...
@@ -288,6 +288,7 @@ static int write_object(
git_odb_object
*
obj
=
NULL
;
git_otype
type
;
unsigned
char
hdr
[
10
],
*
zbuf
=
NULL
;
void
*
delta_data
=
NULL
;
void
*
data
;
size_t
hdr_len
,
zbuf_len
=
COMPRESS_BUFLEN
,
data_len
;
ssize_t
written
;
...
...
@@ -295,10 +296,11 @@ static int write_object(
if
(
po
->
delta
)
{
if
(
po
->
delta_data
)
data
=
po
->
delta_data
;
else
if
((
error
=
get_delta
(
&
data
,
pb
->
odb
,
po
))
<
0
)
d
elta_d
ata
=
po
->
delta_data
;
else
if
((
error
=
get_delta
(
&
d
elta_d
ata
,
pb
->
odb
,
po
))
<
0
)
goto
done
;
data
=
delta_data
;
data_len
=
po
->
delta_size
;
type
=
GIT_OBJ_REF_DELTA
;
}
else
{
...
...
@@ -351,7 +353,7 @@ static int write_object(
}
if
(
po
->
delta
)
git__free
(
data
);
git__free
(
d
elta_d
ata
);
}
if
(
po
->
delta_data
)
{
...
...
src/zstream.c
View file @
1cb5a811
...
...
@@ -70,7 +70,7 @@ int git_zstream_deflatebuf(git_buf *out, const void *in, size_t in_len)
int
error
=
0
;
if
((
error
=
git_zstream_init
(
&
zstream
))
<
0
)
goto
done
;
return
error
;
do
{
if
(
out
->
asize
-
out
->
size
<
BUFFER_SIZE
)
...
...
@@ -89,7 +89,6 @@ int git_zstream_deflatebuf(git_buf *out, const void *in, size_t in_len)
if
(
written
<
0
)
error
=
written
;
done:
git_zstream_free
(
&
zstream
);
return
error
;
}
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