| 144 | } |
| 145 | |
| 146 | static 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 | |
| 164 | static int packet_write_fmt_1(int fd, int gently, const char *prefix, |
| 165 | const char *fmt, va_list args) |
no test coverage detected