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

Function format_packet

pkt-line.c:146–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144}
145
146static void format_packet(struct strbuf *out, const char *prefix,
147 const char *fmt, va_list args)
148{
149 size_t orig_len, n;
150
151 orig_len = out->len;
152 strbuf_addstr(out, "0000");
153 strbuf_addstr(out, prefix);
154 strbuf_vaddf(out, fmt, args);
155 n = out->len - orig_len;
156
157 if (n > LARGE_PACKET_MAX)
158 die(_("protocol error: impossibly long line"));
159
160 set_packet_header(&out->buf[orig_len], n);
161 packet_trace(out->buf + orig_len + 4, n - 4, 1);
162}
163
164static int packet_write_fmt_1(int fd, int gently, const char *prefix,
165 const char *fmt, va_list args)

Callers 3

packet_write_fmt_1Function · 0.85
packet_fwrite_fmtFunction · 0.85
packet_buf_writeFunction · 0.85

Calls 5

strbuf_addstrFunction · 0.85
strbuf_vaddfFunction · 0.85
set_packet_headerFunction · 0.85
packet_traceFunction · 0.85
dieFunction · 0.70

Tested by

no test coverage detected