]>
git.ipfire.org Git - thirdparty/git.git/blob - t/helper/test-read-cache.c
5 int cmd__read_cache(int argc
, const char **argv
)
8 const char *name
= NULL
;
10 initialize_the_repository();
12 if (argc
> 1 && skip_prefix(argv
[1], "--print-and-refresh=", &name
)) {
18 cnt
= strtol(argv
[1], NULL
, 0);
19 setup_git_directory();
20 git_config(git_default_config
, NULL
);
22 for (i
= 0; i
< cnt
; i
++) {
27 refresh_index(&the_index
, REFRESH_QUIET
,
29 pos
= index_name_pos(&the_index
, name
, strlen(name
));
31 die("%s not in index", name
);
32 printf("%s is%s up to date\n", name
,
33 ce_uptodate(the_index
.cache
[pos
]) ? "" : " not");
34 write_file(name
, "%d\n", i
);