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

Function print_ref_status

transport.c:620–662  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618}
619
620static void print_ref_status(char flag, const char *summary,
621 struct ref *to, struct ref *from, const char *msg,
622 struct ref_push_report *report,
623 int porcelain, int summary_width)
624{
625 const char *to_name;
626
627 if (report && report->ref_name)
628 to_name = report->ref_name;
629 else
630 to_name = to->name;
631
632 if (porcelain) {
633 if (from)
634 fprintf(stdout, "%c\t%s:%s\t", flag, from->name, to_name);
635 else
636 fprintf(stdout, "%c\t:%s\t", flag, to_name);
637 if (msg)
638 fprintf(stdout, "%s (%s)\n", summary, msg);
639 else
640 fprintf(stdout, "%s\n", summary);
641 } else {
642 const char *red = "", *reset = "";
643 if (push_had_errors(to)) {
644 red = transport_get_color(TRANSPORT_COLOR_REJECTED);
645 reset = transport_get_color(TRANSPORT_COLOR_RESET);
646 }
647 fprintf(stderr, " %s%c %-*s%s ", red, flag, summary_width,
648 summary, reset);
649 if (from)
650 fprintf(stderr, "%s -> %s",
651 prettify_refname(from->name),
652 prettify_refname(to_name));
653 else
654 fputs(prettify_refname(to_name), stderr);
655 if (msg) {
656 fputs(" (", stderr);
657 fputs(msg, stderr);
658 fputc(')', stderr);
659 }
660 fputc('\n', stderr);
661 }
662}
663
664static void print_ok_ref_status(struct ref *ref,
665 struct ref_push_report *report,

Callers 2

print_ok_ref_statusFunction · 0.85
print_one_push_reportFunction · 0.85

Calls 3

push_had_errorsFunction · 0.85
transport_get_colorFunction · 0.85
prettify_refnameFunction · 0.85

Tested by

no test coverage detected