Raw
1 #define USE_THE_REPOSITORY_VARIABLE
2
3 #include "test-tool.h"
4 #include "read-cache-ll.h"
5 #include "repository.h"
6 #include "setup.h"
7
8 int cmd__dump_fsmonitor(int ac UNUSED, const char **av UNUSED)
9 {
10 struct index_state *istate = the_repository->index;
11
12 setup_git_directory(the_repository);
13 if (do_read_index(istate, the_repository->index_file, 0) < 0)
14 die("unable to read index file");
15 if (!istate->fsmonitor_last_update) {
16 printf("no fsmonitor\n");
17 return 0;
18 }
19 printf("fsmonitor last update %s\n", istate->fsmonitor_last_update);
20
21 for (size_t i = 0; i < istate->cache_nr; i++)
22 printf((istate->cache[i]->ce_flags & CE_FSMONITOR_VALID) ? "+" : "-");
23
24 return 0;
25 }