1 #define USE_THE_INDEX_VARIABLE
8 int cmd__read_cache(int argc
, const char **argv
)
11 const char *name
= NULL
;
13 initialize_the_repository();
15 if (argc
> 1 && skip_prefix(argv
[1], "--print-and-refresh=", &name
)) {
21 cnt
= strtol(argv
[1], NULL
, 0);
22 setup_git_directory();
23 git_config(git_default_config
, NULL
);
25 for (i
= 0; i
< cnt
; i
++) {
26 repo_read_index(the_repository
);
30 refresh_index(&the_index
, REFRESH_QUIET
,
32 pos
= index_name_pos(&the_index
, name
, strlen(name
));
34 die("%s not in index", name
);
35 printf("%s is%s up to date\n", name
,
36 ce_uptodate(the_index
.cache
[pos
]) ? "" : " not");
37 write_file(name
, "%d\n", i
);
39 discard_index(&the_index
);