summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-03-28 13:52:26 -0700
committerJunio C Hamano <gitster@pobox.com>2017-03-28 13:52:26 -0700
commite3c551dd7ba9a3a01da7d9d34cb1cde44dd6f2a3 (patch)
tree5120ca8ad7c6232ac98efeb5f7d17850e6a00a0b
parentba5e05ffeff03c4835d0618ab34acb97ef753d0c (diff)
parentd4aae459cd217c9201e03b270112f5b3ead1f867 (diff)
downloadgit-e3c551dd7ba9a3a01da7d9d34cb1cde44dd6f2a3.tar.gz
Merge branch 'sb/wt-status-cleanup' into maint
Code clean-up. * sb/wt-status-cleanup: wt-status: simplify by using for_each_string_list_item
-rw-r--r--wt-status.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/wt-status.c b/wt-status.c
index 234e77a6d6..4bb46781c8 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1785,34 +1785,24 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
static void wt_shortstatus_print(struct wt_status *s)
{
- int i;
+ struct string_list_item *it;
if (s->show_branch)
wt_shortstatus_print_tracking(s);
- for (i = 0; i < s->change.nr; i++) {
- struct wt_status_change_data *d;
- struct string_list_item *it;
+ for_each_string_list_item(it, &s->change) {
+ struct wt_status_change_data *d = it->util;
- it = &(s->change.items[i]);
- d = it->util;
if (d->stagemask)
wt_shortstatus_unmerged(it, s);
else
wt_shortstatus_status(it, s);
}
- for (i = 0; i < s->untracked.nr; i++) {
- struct string_list_item *it;
-
- it = &(s->untracked.items[i]);
+ for_each_string_list_item(it, &s->untracked)
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, "!!");
- }
}
static void wt_porcelain_print(struct wt_status *s)