2018-09-09 17:36:30 +00:00
|
|
|
#include "test-tool.h"
|
2023-05-16 06:33:56 +00:00
|
|
|
#include "read-cache-ll.h"
|
2023-04-22 20:17:20 +00:00
|
|
|
#include "repository.h"
|
2023-03-21 06:26:05 +00:00
|
|
|
#include "setup.h"
|
2017-09-22 16:35:44 +00:00
|
|
|
|
2023-03-28 20:57:25 +00:00
|
|
|
int cmd__dump_fsmonitor(int ac UNUSED, const char **av UNUSED)
|
2017-09-22 16:35:44 +00:00
|
|
|
{
|
2019-01-24 08:29:12 +00:00
|
|
|
struct index_state *istate = the_repository->index;
|
2017-09-22 16:35:44 +00:00
|
|
|
int i;
|
|
|
|
|
|
|
|
setup_git_directory();
|
2019-01-24 08:29:12 +00:00
|
|
|
if (do_read_index(istate, the_repository->index_file, 0) < 0)
|
2017-09-22 16:35:44 +00:00
|
|
|
die("unable to read index file");
|
|
|
|
if (!istate->fsmonitor_last_update) {
|
|
|
|
printf("no fsmonitor\n");
|
|
|
|
return 0;
|
|
|
|
}
|
2020-01-07 19:04:28 +00:00
|
|
|
printf("fsmonitor last update %s\n", istate->fsmonitor_last_update);
|
2017-09-22 16:35:44 +00:00
|
|
|
|
|
|
|
for (i = 0; i < istate->cache_nr; i++)
|
|
|
|
printf((istate->cache[i]->ce_flags & CE_FSMONITOR_VALID) ? "+" : "-");
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|