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