3 #include "parse-options.h"
5 static const char *read_cache_perf_usage[] = {
6 "test-tool read-cache-perf [<options>...]",
10 int cmd__read_cache_perf(int argc, const char **argv)
12 struct repository *r = the_repository;
15 struct option options[] = {
16 OPT_INTEGER(0, "count", &cnt, "number of passes"),
17 OPT_BOOL(0, "refresh", &refresh,
18 "call refresh_index() in a loop, not read()/discard()"),
22 argc = parse_options(argc, argv, "test-tools", options,
23 read_cache_perf_usage, 0);
25 usage_msg_opt("Too many arguments.", read_cache_perf_usage,
28 usage_msg_opt("Need at least one pass.", read_cache_perf_usage,
31 setup_git_directory();
36 unsigned int flags = REFRESH_QUIET|REFRESH_PROGRESS;
37 refresh_index(r->index, flags, NULL, NULL, NULL);
41 discard_index(r->index);
44 discard_index(r->index);