Merge branch 'sb/wt-status-cleanup'

Code clean-up.

* sb/wt-status-cleanup:
  wt-status: simplify by using for_each_string_list_item
This commit is contained in:
Junio C Hamano 2017-03-21 15:07:18 -07:00
commit 8a3ff8560c

View File

@ -1785,34 +1785,24 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
static void wt_shortstatus_print(struct wt_status *s) static void wt_shortstatus_print(struct wt_status *s)
{ {
int i; struct string_list_item *it;
if (s->show_branch) if (s->show_branch)
wt_shortstatus_print_tracking(s); wt_shortstatus_print_tracking(s);
for (i = 0; i < s->change.nr; i++) { for_each_string_list_item(it, &s->change) {
struct wt_status_change_data *d; struct wt_status_change_data *d = it->util;
struct string_list_item *it;
it = &(s->change.items[i]);
d = it->util;
if (d->stagemask) if (d->stagemask)
wt_shortstatus_unmerged(it, s); wt_shortstatus_unmerged(it, s);
else else
wt_shortstatus_status(it, s); wt_shortstatus_status(it, s);
} }
for (i = 0; i < s->untracked.nr; i++) { for_each_string_list_item(it, &s->untracked)
struct string_list_item *it;
it = &(s->untracked.items[i]);
wt_shortstatus_other(it, s, "??"); wt_shortstatus_other(it, s, "??");
}
for (i = 0; i < s->ignored.nr; i++) {
struct string_list_item *it;
it = &(s->ignored.items[i]); for_each_string_list_item(it, &s->ignored)
wt_shortstatus_other(it, s, "!!"); wt_shortstatus_other(it, s, "!!");
}
} }
static void wt_porcelain_print(struct wt_status *s) static void wt_porcelain_print(struct wt_status *s)