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

Function wt_shortstatus_status

wt-status.c:2043–2075  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2041}
2042
2043static void wt_shortstatus_status(struct string_list_item *it,
2044 struct wt_status *s)
2045{
2046 struct wt_status_change_data *d = it->util;
2047
2048 if (d->index_status)
2049 color_fprintf(s->fp, color(WT_STATUS_UPDATED, s), "%c", d->index_status);
2050 else
2051 fputc(' ', s->fp);
2052 if (d->worktree_status)
2053 color_fprintf(s->fp, color(WT_STATUS_CHANGED, s), "%c", d->worktree_status);
2054 else
2055 fputc(' ', s->fp);
2056 fputc(' ', s->fp);
2057 if (s->null_termination) {
2058 fprintf(s->fp, "%s%c", it->string, 0);
2059 if (d->rename_source)
2060 fprintf(s->fp, "%s%c", d->rename_source, 0);
2061 } else {
2062 struct strbuf onebuf = STRBUF_INIT;
2063 const char *one;
2064
2065 if (d->rename_source) {
2066 one = quote_path(d->rename_source, s->prefix, &onebuf,
2067 QUOTE_PATH_QUOTE_SP);
2068 fprintf(s->fp, "%s -> ", one);
2069 strbuf_release(&onebuf);
2070 }
2071 one = quote_path(it->string, s->prefix, &onebuf, QUOTE_PATH_QUOTE_SP);
2072 fprintf(s->fp, "%s\n", one);
2073 strbuf_release(&onebuf);
2074 }
2075}
2076
2077static void wt_shortstatus_other(struct string_list_item *it,
2078 struct wt_status *s, const char *sign)

Callers 1

wt_shortstatus_printFunction · 0.85

Calls 4

color_fprintfFunction · 0.85
quote_pathFunction · 0.85
strbuf_releaseFunction · 0.85
colorFunction · 0.70

Tested by

no test coverage detected