4 extern struct trace_key trace_fsmonitor
;
7 * Read the fsmonitor index extension and (if configured) restore the
8 * CE_FSMONITOR_VALID state.
10 extern int read_fsmonitor_extension(struct index_state
*istate
, const void *data
, unsigned long sz
);
13 * Write the CE_FSMONITOR_VALID state into the fsmonitor index extension.
15 extern void write_fsmonitor_extension(struct strbuf
*sb
, struct index_state
*istate
);
18 * Add/remove the fsmonitor index extension
20 extern void add_fsmonitor(struct index_state
*istate
);
21 extern void remove_fsmonitor(struct index_state
*istate
);
24 * Add/remove the fsmonitor index extension as necessary based on the current
25 * core.fsmonitor setting.
27 extern void tweak_fsmonitor(struct index_state
*istate
);
30 * Run the configured fsmonitor integration script and clear the
31 * CE_FSMONITOR_VALID bit for any files returned as dirty. Also invalidate
32 * any corresponding untracked cache directory structures. Optimized to only
33 * run the first time it is called.
35 extern void refresh_fsmonitor(struct index_state
*istate
);
38 * Set the given cache entries CE_FSMONITOR_VALID bit. This should be
39 * called any time the cache entry has been updated to reflect the
40 * current state of the file on disk.
42 static inline void mark_fsmonitor_valid(struct cache_entry
*ce
)
45 ce
->ce_flags
|= CE_FSMONITOR_VALID
;
46 trace_printf_key(&trace_fsmonitor
, "mark_fsmonitor_clean '%s'", ce
->name
);
51 * Clear the given cache entry's CE_FSMONITOR_VALID bit and invalidate
52 * any corresponding untracked cache directory structures. This should
53 * be called any time git creates or modifies a file that should
54 * trigger an lstat() or invalidate the untracked cache for the
55 * corresponding directory
57 static inline void mark_fsmonitor_invalid(struct index_state
*istate
, struct cache_entry
*ce
)
60 ce
->ce_flags
&= ~CE_FSMONITOR_VALID
;
61 untracked_cache_invalidate_path(istate
, ce
->name
);
62 trace_printf_key(&trace_fsmonitor
, "mark_fsmonitor_invalid '%s'", ce
->name
);