MCPcopy Index your code
hub / github.com/git/git / strbuf_read_once

Function strbuf_read_once

strbuf.c:560–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

558}
559
560ssize_t strbuf_read_once(struct strbuf *sb, int fd, size_t hint)
561{
562 size_t oldalloc = sb->alloc;
563 ssize_t cnt;
564
565 strbuf_grow(sb, hint ? hint : 8192);
566 cnt = xread(fd, sb->buf + sb->len, sb->alloc - sb->len - 1);
567 if (cnt > 0)
568 strbuf_setlen(sb, sb->len + cnt);
569 else if (oldalloc == 0)
570 strbuf_release(sb);
571 return cnt;
572}
573
574ssize_t strbuf_write(struct strbuf *sb, FILE *f)
575{

Callers 2

pump_io_roundFunction · 0.85
pp_buffer_ioFunction · 0.85

Calls 4

strbuf_growFunction · 0.85
xreadFunction · 0.85
strbuf_setlenFunction · 0.85
strbuf_releaseFunction · 0.85

Tested by

no test coverage detected