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
cd2fe662
Commit
cd2fe662
authored
Apr 05, 2020
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
indexer: use GIT_ASSERT
parent
1fa339be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
src/indexer.c
+10
-6
No files found.
src/indexer.c
View file @
cd2fe662
...
...
@@ -239,7 +239,8 @@ static int hash_object_stream(git_indexer*idx, git_packfile_stream *stream)
{
ssize_t
read
;
assert
(
idx
&&
stream
);
GIT_ASSERT_ARG
(
idx
);
GIT_ASSERT_ARG
(
stream
);
do
{
if
((
read
=
git_packfile_stream_read
(
stream
,
idx
->
objbuf
,
sizeof
(
idx
->
objbuf
)))
<
0
)
...
...
@@ -262,7 +263,7 @@ static int advance_delta_offset(git_indexer *idx, git_object_t type)
{
git_mwindow
*
w
=
NULL
;
assert
(
type
==
GIT_OBJECT_REF_DELTA
||
type
==
GIT_OBJECT_OFS_DELTA
);
GIT_ASSERT_ARG
(
type
==
GIT_OBJECT_REF_DELTA
||
type
==
GIT_OBJECT_OFS_DELTA
);
if
(
type
==
GIT_OBJECT_REF_DELTA
)
{
idx
->
off
+=
GIT_OID_RAWSZ
;
...
...
@@ -282,7 +283,7 @@ static int read_object_stream(git_indexer *idx, git_packfile_stream *stream)
{
ssize_t
read
;
assert
(
stream
);
GIT_ASSERT_ARG
(
stream
);
do
{
read
=
git_packfile_stream_read
(
stream
,
idx
->
objbuf
,
sizeof
(
idx
->
objbuf
));
...
...
@@ -612,7 +613,8 @@ static int write_at(git_indexer *idx, const void *data, off64_t offset, size_t s
git_map
map
;
int
error
;
assert
(
data
&&
size
);
GIT_ASSERT_ARG
(
data
);
GIT_ASSERT_ARG
(
size
);
if
((
error
=
git__mmap_alignment
(
&
mmap_alignment
))
<
0
)
return
error
;
...
...
@@ -759,7 +761,9 @@ int git_indexer_append(git_indexer *idx, const void *data, size_t size, git_inde
struct
git_pack_header
*
hdr
=
&
idx
->
hdr
;
git_mwindow_file
*
mwf
=
&
idx
->
pack
->
mwf
;
assert
(
idx
&&
data
&&
stats
);
GIT_ASSERT_ARG
(
idx
);
GIT_ASSERT_ARG
(
data
);
GIT_ASSERT_ARG
(
stats
);
if
((
error
=
append_to_pack
(
idx
,
data
,
size
))
<
0
)
return
error
;
...
...
@@ -950,7 +954,7 @@ static int fix_thin_pack(git_indexer *idx, git_indexer_progress *stats)
unsigned
int
left
=
0
;
git_oid
base
;
assert
(
git_vector_length
(
&
idx
->
deltas
)
>
0
);
GIT_ASSERT
(
git_vector_length
(
&
idx
->
deltas
)
>
0
);
if
(
idx
->
odb
==
NULL
)
{
git_error_set
(
GIT_ERROR_INDEXER
,
"cannot fix a thin pack without an ODB"
);
...
...
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