5 int cmd__read_cache(int argc, const char **argv)
7 int i, cnt = 1, namelen;
8 const char *name = NULL;
10 if (argc > 1 && skip_prefix(argv[1], "--print-and-refresh=", &name)) {
11 namelen = strlen(name);
17 cnt = strtol(argv[1], NULL, 0);
18 setup_git_directory();
19 git_config(git_default_config, NULL);
20 for (i = 0; i < cnt; i++) {
25 refresh_index(&the_index, REFRESH_QUIET,
27 pos = index_name_pos(&the_index, name, namelen);
29 die("%s not in index", name);
30 printf("%s is%s up to date\n", name,
31 ce_uptodate(the_index.cache[pos]) ? "" : " not");
32 write_file(name, "%d\n", i);