| #define USE_THE_REPOSITORY_VARIABLE |
| #include "read-cache-ll.h" |
| int cmd__read_cache(int argc, const char **argv) |
| if (argc > 1 && skip_prefix(argv[1], "--print-and-refresh=", &name)) { |
| cnt = strtol(argv[1], NULL, 0); |
| git_config(git_default_config, NULL); |
| for (i = 0; i < cnt; i++) { |
| repo_read_index(the_repository); |
| refresh_index(the_repository->index, REFRESH_QUIET, |
| pos = index_name_pos(the_repository->index, name, strlen(name)); |
| die("%s not in index", name); |
| printf("%s is%s up to date\n", name, |
| ce_uptodate(the_repository->index->cache[pos]) ? "" : " not"); |
| write_file(name, "%d\n", i); |
| discard_index(the_repository->index); |