Example #1
0
static void wt_status_print_changed_cb(struct diff_queue_struct *q,
                                       struct diff_options *options,
                                       void *data)
{
    struct wt_status *s = data;
    int i;
    if (q->nr) {
        int has_deleted = 0;
        s->workdir_dirty = 1;
        for (i = 0; i < q->nr; i++)
            if (q->queue[i]->status == DIFF_STATUS_DELETED) {
                has_deleted = 1;
                break;
            }
        wt_status_print_dirty_header(s, has_deleted);
    }
    for (i = 0; i < q->nr; i++)
        wt_status_print_filepair(s, WT_STATUS_CHANGED, q->queue[i]);
    if (q->nr)
        wt_status_print_trailer(s);
}
Example #2
0
static void wt_status_print_changed(struct wt_status *s)
{
	int i, dirty_submodules;
	int worktree_changes = wt_status_check_worktree_changes(s, &dirty_submodules);

	if (!worktree_changes)
		return;

	wt_status_print_dirty_header(s, worktree_changes < 0, dirty_submodules);

	for (i = 0; i < s->change.nr; i++) {
		struct wt_status_change_data *d;
		struct string_list_item *it;
		it = &(s->change.items[i]);
		d = it->util;
		if (!d->worktree_status ||
		    d->worktree_status == DIFF_STATUS_UNMERGED)
			continue;
		wt_status_print_change_data(s, WT_STATUS_CHANGED, it);
	}
	wt_status_print_trailer(s);
}