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