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
33c5c513
Commit
33c5c513
authored
Apr 05, 2020
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filebuf: use GIT_ASSERT
parent
a08bd547
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
src/filebuf.c
+9
-7
No files found.
src/filebuf.c
View file @
33c5c513
...
...
@@ -184,7 +184,7 @@ static int write_deflate(git_filebuf *file, void *source, size_t len)
}
while
(
zs
->
avail_out
==
0
);
assert
(
zs
->
avail_in
==
0
);
GIT_ASSERT
(
zs
->
avail_in
==
0
);
if
(
file
->
compute_digest
)
git_hash_update
(
&
file
->
digest
,
source
,
len
);
...
...
@@ -278,10 +278,9 @@ int git_filebuf_open_withsize(git_filebuf *file, const char *path, int flags, mo
int
compression
,
error
=
-
1
;
size_t
path_len
,
alloc_len
;
/* opening an already open buffer is a programming error;
* assert that this never happens instead of returning
* an error code */
assert
(
file
&&
path
&&
file
->
buffer
==
NULL
);
GIT_ASSERT_ARG
(
file
);
GIT_ASSERT_ARG
(
path
);
GIT_ASSERT
(
file
->
buffer
==
NULL
);
memset
(
file
,
0x0
,
sizeof
(
git_filebuf
));
...
...
@@ -389,7 +388,9 @@ cleanup:
int
git_filebuf_hash
(
git_oid
*
oid
,
git_filebuf
*
file
)
{
assert
(
oid
&&
file
&&
file
->
compute_digest
);
GIT_ASSERT_ARG
(
oid
);
GIT_ASSERT_ARG
(
file
);
GIT_ASSERT_ARG
(
file
->
compute_digest
);
flush_buffer
(
file
);
...
...
@@ -415,7 +416,8 @@ int git_filebuf_commit_at(git_filebuf *file, const char *path)
int
git_filebuf_commit
(
git_filebuf
*
file
)
{
/* temporary files cannot be committed */
assert
(
file
&&
file
->
path_original
);
GIT_ASSERT_ARG
(
file
);
GIT_ASSERT
(
file
->
path_original
);
file
->
flush_mode
=
Z_FINISH
;
flush_buffer
(
file
);
...
...
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