|
3 | 3 | #include "dir.h"
|
4 | 4 | #include "streaming.h"
|
5 | 5 | #include "submodule.h"
|
| 6 | +#include "progress.h" |
6 | 7 |
|
7 | 8 | static void create_directories(const char *path, int path_len,
|
8 | 9 | const struct checkout *state)
|
@@ -161,16 +162,22 @@ static int remove_available_paths(struct string_list_item *item, void *cb_data)
|
161 | 162 | int finish_delayed_checkout(struct checkout *state)
|
162 | 163 | {
|
163 | 164 | int errs = 0;
|
| 165 | + unsigned delayed_object_count; |
| 166 | + off_t filtered_bytes = 0; |
164 | 167 | struct string_list_item *filter, *path;
|
| 168 | + struct progress *progress; |
165 | 169 | struct delayed_checkout *dco = state->delayed_checkout;
|
166 | 170 |
|
167 | 171 | if (!state->delayed_checkout)
|
168 | 172 | return errs;
|
169 | 173 |
|
170 | 174 | dco->state = CE_RETRY;
|
| 175 | + delayed_object_count = dco->paths.nr; |
| 176 | + progress = start_delayed_progress(_("Filtering content"), delayed_object_count); |
171 | 177 | while (dco->filters.nr > 0) {
|
172 | 178 | for_each_string_list_item(filter, &dco->filters) {
|
173 | 179 | struct string_list available_paths = STRING_LIST_INIT_NODUP;
|
| 180 | + display_progress(progress, delayed_object_count - dco->paths.nr); |
174 | 181 |
|
175 | 182 | if (!async_query_available_blobs(filter->string, &available_paths)) {
|
176 | 183 | /* Filter reported an error */
|
@@ -216,11 +223,17 @@ int finish_delayed_checkout(struct checkout *state)
|
216 | 223 | }
|
217 | 224 | ce = index_file_exists(state->istate, path->string,
|
218 | 225 | strlen(path->string), 0);
|
219 |
| - errs |= (ce ? checkout_entry(ce, state, NULL) : 1); |
| 226 | + if (ce) { |
| 227 | + errs |= checkout_entry(ce, state, NULL); |
| 228 | + filtered_bytes += ce->ce_stat_data.sd_size; |
| 229 | + display_throughput(progress, filtered_bytes); |
| 230 | + } else |
| 231 | + errs = 1; |
220 | 232 | }
|
221 | 233 | }
|
222 | 234 | string_list_remove_empty_items(&dco->filters, 0);
|
223 | 235 | }
|
| 236 | + stop_progress(&progress); |
224 | 237 | string_list_clear(&dco->filters, 0);
|
225 | 238 |
|
226 | 239 | /* At this point we should not have any delayed paths anymore. */
|
|
0 commit comments