2018-09-09 19:36:30 +02:00
|
|
|
#include "test-tool.h"
|
2017-09-22 18:35:44 +02:00
|
|
|
#include "cache.h"
|
|
|
|
|
2018-09-09 19:36:30 +02:00
|
|
|
int cmd__dump_fsmonitor(int ac, const char **av)
|
2017-09-22 18:35:44 +02:00
|
|
|
{
|
2019-01-24 09:29:12 +01:00
|
|
|
struct index_state *istate = the_repository->index;
|
2017-09-22 18:35:44 +02:00
|
|
|
int i;
|
|
|
|
|
|
|
|
setup_git_directory();
|
2019-01-24 09:29:12 +01:00
|
|
|
if (do_read_index(istate, the_repository->index_file, 0) < 0)
|
2017-09-22 18:35:44 +02:00
|
|
|
die("unable to read index file");
|
|
|
|
if (!istate->fsmonitor_last_update) {
|
|
|
|
printf("no fsmonitor\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
printf("fsmonitor last update %"PRIuMAX"\n", (uintmax_t)istate->fsmonitor_last_update);
|
|
|
|
|
|
|
|
for (i = 0; i < istate->cache_nr; i++)
|
|
|
|
printf((istate->cache[i]->ce_flags & CE_FSMONITOR_VALID) ? "+" : "-");
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|