#include "pathspec.h"
#include "dir.h"
#include "fsmonitor.h"
+#include "config.h"
+ #include "progress.h"
#ifdef NO_PTHREADS
static void preload_index(struct index_state *index,
{
int threads, i, work, offset;
struct thread_data data[MAX_PARALLEL];
- uint64_t start = getnanotime();
+ struct progress_data pd;
if (!core_preload_index)
return;
if (pthread_join(p->pthread, NULL))
die("unable to join threaded lstat");
}
- trace_performance_since(start, "preload index");
+ stop_progress(&pd.progress);
+
+ trace_performance_leave("preload index");
}
#endif
#include "split-index.h"
#include "utf8.h"
#include "fsmonitor.h"
+#include "thread-utils.h"
+ #include "progress.h"
/* Mask for the name length in ce_flags in the on-disk index */
const char *typechange_fmt;
const char *added_fmt;
const char *unmerged_fmt;
- uint64_t start = getnanotime();
+ struct progress *progress = NULL;
+
+ if (flags & REFRESH_PROGRESS && isatty(2))
+ progress = start_delayed_progress(_("Refresh index"),
+ istate->cache_nr);
+ trace_performance_enter();
modified_fmt = (in_porcelain ? "M\t%s\n" : "%s: needs update\n");
deleted_fmt = (in_porcelain ? "D\t%s\n" : "%s: needs update\n");
typechange_fmt = (in_porcelain ? "T\t%s\n" : "%s needs update\n");
replace_index_entry(istate, i, new_entry);
}
- trace_performance_since(start, "refresh index");
+ if (progress) {
+ display_progress(progress, istate->cache_nr);
+ stop_progress(&progress);
+ }
+ trace_performance_leave("refresh index");
return has_errors;
}