MCPcopy Create free account
hub / github.com/git/git / git_inflate

Function git_inflate

git-zlib.c:132–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132int git_inflate(git_zstream *strm, int flush)
133{
134 int status;
135
136 for (;;) {
137 zlib_pre_call(strm);
138 /* Never say Z_FINISH unless we are feeding everything */
139 status = inflate(&strm->z,
140 (strm->z.avail_in != strm->avail_in)
141 ? 0 : flush);
142 if (status == Z_MEM_ERROR)
143 die("inflate: out of memory");
144 zlib_post_call(strm, status);
145
146 /*
147 * Let zlib work another round, while we can still
148 * make progress.
149 */
150 if ((strm->avail_out && !strm->z.avail_out) &&
151 (status == Z_OK || status == Z_BUF_ERROR))
152 continue;
153 break;
154 }
155
156 switch (status) {
157 /* Z_BUF_ERROR: normal, needs more space in the output buffer */
158 case Z_BUF_ERROR:
159 case Z_OK:
160 case Z_STREAM_END:
161 return status;
162 default:
163 break;
164 }
165 error("inflate: %s (%s)", zerr_to_string(status),
166 strm->z.msg ? strm->z.msg : "no message");
167 return status;
168}
169
170unsigned long git_deflate_bound(git_zstream *strm, unsigned long size)
171{

Callers 15

unpack_loose_headerFunction · 0.85
unpack_loose_restFunction · 0.85
check_stream_oidFunction · 0.85
fwrite_sha1_fileFunction · 0.85
get_size_from_deltaFunction · 0.85
unpack_compressed_entryFunction · 0.85
inflate_itFunction · 0.85
inflate_requestFunction · 0.85
unpack_entry_dataFunction · 0.85
unpack_dataFunction · 0.85
check_pack_inflateFunction · 0.85

Calls 5

zlib_pre_callFunction · 0.85
zlib_post_callFunction · 0.85
errorFunction · 0.85
zerr_to_stringFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected