2018-09-09 19:36:30 +02:00
|
|
|
#include "test-tool.h"
|
2017-09-22 18:35:44 +02:00
|
|
|
#include "cache.h"
|
2023-03-21 07:26:05 +01:00
|
|
|
#include "setup.h"
|
2017-09-22 18:35:44 +02:00
|
|
|
|
2023-03-28 22:57:25 +02:00
|
|
|
int cmd__dump_fsmonitor(int ac UNUSED, const char **av UNUSED)
|
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;
|
|
|
|
}
|
2020-01-07 20:04:28 +01:00
|
|
|
printf("fsmonitor last update %s\n", istate->fsmonitor_last_update);
|
2017-09-22 18:35:44 +02:00
|
|
|
|
|
|
|
for (i = 0; i < istate->cache_nr; i++)
|
|
|
|
printf((istate->cache[i]->ce_flags & CE_FSMONITOR_VALID) ? "+" : "-");
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|