summaryrefslogtreecommitdiff
path: root/entry.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-09-10 08:08:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-09-10 08:08:22 (GMT)
commit7fbbd3ec0f62b9147e867dee1916cd38d28e7b19 (patch)
treea740428fb6795435dde7feb4e7b3c786192bb796 /entry.c
parent8e36002adda45a35c6fc4daf81913c3d2102cb59 (diff)
parent52f1d62eb44faf569edca360ec9af9ddd4045fe0 (diff)
downloadgit-7fbbd3ec0f62b9147e867dee1916cd38d28e7b19.zip
git-7fbbd3ec0f62b9147e867dee1916cd38d28e7b19.tar.gz
git-7fbbd3ec0f62b9147e867dee1916cd38d28e7b19.tar.bz2
Merge branch 'ls/convert-filter-progress'
The codepath to call external process filter for smudge/clean operation learned to show the progress meter. * ls/convert-filter-progress: convert: display progress for filtered objects that have been delayed
Diffstat (limited to 'entry.c')
-rw-r--r--entry.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/entry.c b/entry.c
index 65458f0..cb291aa 100644
--- a/entry.c
+++ b/entry.c
@@ -3,6 +3,7 @@
#include "dir.h"
#include "streaming.h"
#include "submodule.h"
+#include "progress.h"
static void create_directories(const char *path, int path_len,
const struct checkout *state)
@@ -161,16 +162,22 @@ static int remove_available_paths(struct string_list_item *item, void *cb_data)
int finish_delayed_checkout(struct checkout *state)
{
int errs = 0;
+ unsigned delayed_object_count;
+ off_t filtered_bytes = 0;
struct string_list_item *filter, *path;
+ struct progress *progress;
struct delayed_checkout *dco = state->delayed_checkout;
if (!state->delayed_checkout)
return errs;
dco->state = CE_RETRY;
+ delayed_object_count = dco->paths.nr;
+ progress = start_delayed_progress(_("Filtering content"), delayed_object_count);
while (dco->filters.nr > 0) {
for_each_string_list_item(filter, &dco->filters) {
struct string_list available_paths = STRING_LIST_INIT_NODUP;
+ display_progress(progress, delayed_object_count - dco->paths.nr);
if (!async_query_available_blobs(filter->string, &available_paths)) {
/* Filter reported an error */
@@ -216,11 +223,17 @@ int finish_delayed_checkout(struct checkout *state)
}
ce = index_file_exists(state->istate, path->string,
strlen(path->string), 0);
- errs |= (ce ? checkout_entry(ce, state, NULL) : 1);
+ if (ce) {
+ errs |= checkout_entry(ce, state, NULL);
+ filtered_bytes += ce->ce_stat_data.sd_size;
+ display_throughput(progress, filtered_bytes);
+ } else
+ errs = 1;
}
}
string_list_remove_empty_items(&dco->filters, 0);
}
+ stop_progress(&progress);
string_list_clear(&dco->filters, 0);
/* At this point we should not have any delayed paths anymore. */