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

Function verify_buffer_or_die

csum-file.c:17–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15#include "progress.h"
16
17static void verify_buffer_or_die(struct hashfile *f,
18 const void *buf,
19 unsigned int count)
20{
21 ssize_t ret = read_in_full(f->check_fd, f->check_buffer, count);
22
23 if (ret < 0)
24 die_errno("%s: sha1 file read error", f->name);
25 if ((size_t)ret != count)
26 die("%s: sha1 file truncated", f->name);
27 if (memcmp(buf, f->check_buffer, count))
28 die("sha1 file '%s' validation error", f->name);
29}
30
31static void flush(struct hashfile *f, const void *buf, unsigned int count)
32{

Callers 1

flushFunction · 0.85

Calls 3

read_in_fullFunction · 0.85
die_errnoFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected