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

Function show_http_message

remote-curl.c:370–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

368}
369
370static int show_http_message(struct strbuf *type, struct strbuf *charset,
371 struct strbuf *msg)
372{
373 const char *p, *eol;
374
375 /*
376 * We only show text/plain parts, as other types are likely
377 * to be ugly to look at on the user's terminal.
378 */
379 if (strcmp(type->buf, "text/plain"))
380 return -1;
381 if (charset->len)
382 strbuf_reencode(msg, charset->buf, get_log_output_encoding());
383
384 strbuf_trim(msg);
385 if (!msg->len)
386 return -1;
387
388 p = msg->buf;
389 do {
390 eol = strchrnul(p, '\n');
391 fprintf(stderr, "remote: %.*s\n", (int)(eol - p), p);
392 p = eol + 1;
393 } while(*eol);
394 return 0;
395}
396
397static int get_protocol_http_header(enum protocol_version version,
398 struct strbuf *header)

Callers 1

discover_refsFunction · 0.85

Calls 3

strbuf_reencodeFunction · 0.85
get_log_output_encodingFunction · 0.85
strbuf_trimFunction · 0.85

Tested by

no test coverage detected