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
a072a025
Commit
a072a025
authored
Apr 05, 2020
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
odb_pack: use GIT_ASSERT
parent
3bb9916c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
src/odb_pack.c
+18
-8
No files found.
src/odb_pack.c
View file @
a072a025
...
...
@@ -358,7 +358,10 @@ static int pack_backend__read_header(
struct
git_pack_entry
e
;
int
error
;
assert
(
len_p
&&
type_p
&&
backend
&&
oid
);
GIT_ASSERT_ARG
(
len_p
);
GIT_ASSERT_ARG
(
type_p
);
GIT_ASSERT_ARG
(
backend
);
GIT_ASSERT_ARG
(
oid
);
if
((
error
=
pack_entry_find
(
&
e
,
(
struct
pack_backend
*
)
backend
,
oid
))
<
0
)
return
error
;
...
...
@@ -469,7 +472,9 @@ static int pack_backend__foreach(git_odb_backend *_backend, git_odb_foreach_cb c
struct
pack_backend
*
backend
;
unsigned
int
i
;
assert
(
_backend
&&
cb
);
GIT_ASSERT_ARG
(
_backend
);
GIT_ASSERT_ARG
(
cb
);
backend
=
(
struct
pack_backend
*
)
_backend
;
/* Make sure we know about the packfiles */
...
...
@@ -488,7 +493,7 @@ static int pack_backend__writepack_append(struct git_odb_writepack *_writepack,
{
struct
pack_writepack
*
writepack
=
(
struct
pack_writepack
*
)
_writepack
;
assert
(
writepack
);
GIT_ASSERT_ARG
(
writepack
);
return
git_indexer_append
(
writepack
->
indexer
,
data
,
size
,
stats
);
}
...
...
@@ -497,16 +502,19 @@ static int pack_backend__writepack_commit(struct git_odb_writepack *_writepack,
{
struct
pack_writepack
*
writepack
=
(
struct
pack_writepack
*
)
_writepack
;
assert
(
writepack
);
GIT_ASSERT_ARG
(
writepack
);
return
git_indexer_commit
(
writepack
->
indexer
,
stats
);
}
static
void
pack_backend__writepack_free
(
struct
git_odb_writepack
*
_writepack
)
{
struct
pack_writepack
*
writepack
=
(
struct
pack_writepack
*
)
_writepack
;
struct
pack_writepack
*
writepack
;
if
(
!
_writepack
)
return
;
assert
(
writepack
)
;
writepack
=
(
struct
pack_writepack
*
)
_writepack
;
git_indexer_free
(
writepack
->
indexer
);
git__free
(
writepack
);
...
...
@@ -522,7 +530,8 @@ static int pack_backend__writepack(struct git_odb_writepack **out,
struct
pack_backend
*
backend
;
struct
pack_writepack
*
writepack
;
assert
(
out
&&
_backend
);
GIT_ASSERT_ARG
(
out
);
GIT_ASSERT_ARG
(
_backend
);
*
out
=
NULL
;
...
...
@@ -555,7 +564,8 @@ static void pack_backend__free(git_odb_backend *_backend)
struct
pack_backend
*
backend
;
size_t
i
;
assert
(
_backend
);
if
(
!
_backend
)
return
;
backend
=
(
struct
pack_backend
*
)
_backend
;
...
...
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