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

Function hashfile_truncate

csum-file.c:214–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214int hashfile_truncate(struct hashfile *f, struct hashfile_checkpoint *checkpoint)
215{
216 off_t offset = checkpoint->offset;
217
218 if (ftruncate(f->fd, offset) ||
219 lseek(f->fd, offset, SEEK_SET) != offset)
220 return -1;
221 f->total = offset;
222 git_hash_clone(&f->ctx, &checkpoint->ctx);
223 f->offset = 0; /* hashflush() was called in checkpoint */
224 return 0;
225}
226
227void crc32_begin(struct hashfile *f)
228{

Callers 2

truncate_packFunction · 0.85

Calls 1

git_hash_cloneFunction · 0.85

Tested by

no test coverage detected