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
e7eb6c6b
Commit
e7eb6c6b
authored
Aug 30, 2021
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
midx: return an error when detected
parent
5eb2b0b3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
src/midx.c
+7
-3
No files found.
src/midx.c
View file @
e7eb6c6b
...
...
@@ -714,8 +714,10 @@ static int midx_write(
error
=
git_vector_init
(
&
object_entries
,
git_array_size
(
object_entries_array
),
object_entry__cmp
);
if
(
error
<
0
)
goto
cleanup
;
git_array_foreach
(
object_entries_array
,
i
,
entry
)
error
=
git_vector_set
(
NULL
,
&
object_entries
,
i
,
entry
);
git_array_foreach
(
object_entries_array
,
i
,
entry
)
{
if
((
error
=
git_vector_set
(
NULL
,
&
object_entries
,
i
,
entry
))
<
0
)
goto
cleanup
;
}
git_vector_set_sorted
(
&
object_entries
,
0
);
git_vector_sort
(
&
object_entries
);
git_vector_uniq
(
&
object_entries
,
NULL
);
...
...
@@ -751,10 +753,12 @@ static int midx_write(
goto
cleanup
;
if
(
entry
->
offset
>=
0x80000000l
)
{
word
=
htonl
(
0x80000000u
|
object_large_offsets_count
++
);
error
=
write_offset
(
entry
->
offset
,
midx_write_buf
,
&
object_large_offsets
);
if
((
error
=
write_offset
(
entry
->
offset
,
midx_write_buf
,
&
object_large_offsets
))
<
0
)
goto
cleanup
;
}
else
{
word
=
htonl
((
uint32_t
)
entry
->
offset
&
0x7fffffffu
);
}
error
=
git_buf_put
(
&
object_offsets
,
(
const
char
*
)
&
word
,
sizeof
(
word
));
if
(
error
<
0
)
goto
cleanup
;
...
...
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