]> git.ipfire.org Git - thirdparty/git.git/blame - t/helper/test-dump-fsmonitor.c
The fifth batch
[thirdparty/git.git] / t / helper / test-dump-fsmonitor.c
CommitLineData
f1ef0b02 1#include "test-tool.h"
08c46a49 2#include "read-cache-ll.h"
d1cbe1e6 3#include "repository.h"
e38da487 4#include "setup.h"
dd3551f4 5
126e3b3d 6int cmd__dump_fsmonitor(int ac UNUSED, const char **av UNUSED)
dd3551f4 7{
f8adbec9 8 struct index_state *istate = the_repository->index;
dd3551f4
BP
9 int i;
10
11 setup_git_directory();
f8adbec9 12 if (do_read_index(istate, the_repository->index_file, 0) < 0)
dd3551f4
BP
13 die("unable to read index file");
14 if (!istate->fsmonitor_last_update) {
15 printf("no fsmonitor\n");
16 return 0;
17 }
56c69100 18 printf("fsmonitor last update %s\n", istate->fsmonitor_last_update);
dd3551f4
BP
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}